Received: by 2002:a05:6a10:2726:0:0:0:0 with SMTP id ib38csp3529263pxb; Mon, 4 Apr 2022 20:04:15 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwkyz39djNB+1bhUzSIKujjYdW1+WnQ06VfGWhIU7ERL+A12IM7zIWMWJanoDiwzQNj26kH X-Received: by 2002:a17:90a:cc0d:b0:1ca:c47f:a8f6 with SMTP id b13-20020a17090acc0d00b001cac47fa8f6mr1526617pju.1.1649127854929; Mon, 04 Apr 2022 20:04:14 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1649127854; cv=none; d=google.com; s=arc-20160816; b=zSZKIYHR+STKuBLfykq59+BV6MGf55FSrQGqx8kk+3ENsnBJW/dcMp7oL8+oZVyICr Y98hjUWnXhYTEnDRs1RfBJ3O0XcASUPDuKCQRCyGBSYRdYVRXK0046VPn5e+1ZFJR6KM qcr6XNFbYV4EOmO9ZiB8y9FnFMgqbrTTH+XbZAjfuLNjcHv1j1wB4dRLxqXLJVs5cCE6 +EWrBkrn/8rgroeIQp4TIh3BpCxv1WSRM0s6Tu2oy9xmHD3r9uDZZ932MxJIC+nB4MSs p0HO84PfnMQ22PeODFHurG9un1GZNd0LzyX2OW3P7bfg3DmA6exy7tHIcBSajG0Q0xun v0AA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:cc:to:subject:message-id:date:from:in-reply-to :references:mime-version; bh=FwKvzDls4uZguxFUkLXf4+nfUJikOvM4SY7CUtlSysk=; b=A6uJJV3w185uQMoGU6hFiOs7qa5BBSLcVv4SPYCc/XmBxedCPK6R1eTwGZgpOB56x5 h8rU9ATdzxVv30LHod07LmW5HqrpHji9wvmOUR5zwPPq6sctc3vvUas9tBu589rLGxN6 l6vOOUc1iHGyQE/ImQ5NeniyS0v8vgVvpdZhaaeuKHATF9Y01uzOnYdS/mOmUUA8tLYp P7wxJ5pXMKNuFnMH2oQc5hZ3PD0RD67zCBmYU5tmUCvID6C1BJftmH//3NaEgKnn4r9h /5hzm61J2nDBTXeup/ofoIiq4qNhIXdyfr4ifFuMa8avSN9gXBM2qeBfB1BYvxQqL96i i2uQ== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from lindbergh.monkeyblade.net (lindbergh.monkeyblade.net. [2620:137:e000::1:18]) by mx.google.com with ESMTPS id q17-20020a17090311d100b00153b2d16560si13121130plh.360.2022.04.04.20.04.14 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 04 Apr 2022 20:04:14 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:18 as permitted sender) client-ip=2620:137:e000::1:18; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id DE7C5335E55; Mon, 4 Apr 2022 18:28:40 -0700 (PDT) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S241185AbiDBV2m (ORCPT + 99 others); Sat, 2 Apr 2022 17:28:42 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:56646 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229636AbiDBV2j (ORCPT ); Sat, 2 Apr 2022 17:28:39 -0400 Received: from mout.kundenserver.de (mout.kundenserver.de [217.72.192.75]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id C8883252A8; Sat, 2 Apr 2022 14:26:46 -0700 (PDT) Received: from mail-wm1-f44.google.com ([209.85.128.44]) by mrelayeu.kundenserver.de (mreue109 [213.165.67.113]) with ESMTPSA (Nemesis) id 1MbAYo-1o7c323umW-00bY9M; Sat, 02 Apr 2022 23:26:44 +0200 Received: by mail-wm1-f44.google.com with SMTP id n63-20020a1c2742000000b0038d0c31db6eso3413631wmn.1; Sat, 02 Apr 2022 14:26:44 -0700 (PDT) X-Gm-Message-State: AOAM5322Clzfnf/qwSNK/kgsENGPMT97WynnqBMnVAe1Wso/xJZokitl 60brgr31KhgccU3BFtc1bt3r0VQiBzLt3Id0ccU= X-Received: by 2002:a05:600c:4e11:b0:38c:bd19:e72c with SMTP id b17-20020a05600c4e1100b0038cbd19e72cmr13758469wmq.174.1648934804584; Sat, 02 Apr 2022 14:26:44 -0700 (PDT) MIME-Version: 1.0 References: <20220321165049.35985-1-sven@svenpeter.dev> <20220321165049.35985-7-sven@svenpeter.dev> <7876eb84-9803-48dc-ab6b-27d49858e27a@www.fastmail.com> In-Reply-To: <7876eb84-9803-48dc-ab6b-27d49858e27a@www.fastmail.com> From: Arnd Bergmann Date: Sat, 2 Apr 2022 23:26:28 +0200 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: [PATCH 6/9] nvme-apple: Add initial Apple SoC NVMe driver To: Sven Peter Cc: Arnd Bergmann , Keith Busch , "axboe@fb.com" , "hch@lst.de" , "sagi@grimberg.me" , Hector Martin , Alyssa Rosenzweig , Rob Herring , Marc Zyngier , DTML , Linux ARM , Linux Kernel Mailing List , linux-nvme@lists.infradead.org Content-Type: text/plain; charset="UTF-8" X-Provags-ID: V03:K1:QVlumoECcVTiHC5u2S6Rwvxgn5vdkFihYQYtznc++DhQvJ0F2RK ZxtOtoSPeY5khKzM3uVVpREH9ML7BSTfAkH/Kj5Numjl7p5Glx7Phv10C+9LYZkQDTXQ5Bh WWGgTGgHnVD6jrRIi+ysVHNwFuLGJyUIFOasFbT8BF0CXjq1kucH06rq8MRM6ih2Q7EpAD0 qGlZDBI9aTNflsiDx3vAQ== X-UI-Out-Filterresults: notjunk:1;V03:K0:pFhRKGiCbjo=:1N0YG1QrJF/QXWd9niqOW7 0Gtz5sVAx85pNw/WcR406dvkC1b2nta17SmsrgEDR/S9uIJYCBXF3SAPDVPBq0mTULFglJA2b mVrhPKo7KM7MKvIpd1C3Fy9lmlP6qUwRAQXgXkYahkhSn0W0EXk4DnmCn6C509wTe4A/x9AK9 eh5GQxhekhq91CsLoiOMWsBYdVSlMaYDD4WgD7f9iVjKibAR+AGcCpvnpaILbU69BRVpMjpln +rGEDkBhJAX46bn+Ux6ujeThhOcC8S0J/iSfFGO7R3phB6gKbXaosUJJoFEZlcDV3+pHmLK1N otnGRRP0Cju3bBp5RpGwHC8GbVGJcRbbcLobejJVdL+boBCBV6qyAjVpY8SdHOexFD7hXpH5B YsvI+TuJdzfyjJUtfBXsV61+jtS37U+T0HV8PC6z8VwTGkXn2jAdFZIp0SusPsODFuDYpP2E4 Y1FZS87VbbvRyF4RAcKP3Y32D405L/JiN01gSmLWmOW2liFw8DIgXwW1m4E2iHuI9c65Mypa0 N+vXLekHd5OW87k9Gpe3MqjLTRbQfW49vg5wm+ErDYk26HD4yaKPjMwz+dWdzKxVNDJtbpblW SBcQSdGgfnatGe/T4Az0SbO448nmqPMHMNMi6svahoNAqxGt5mCajxp3e1+UIJMkZSGhnkzW6 zmsMdnYmRcylLg7ETIRSipMkmcmcGQiu9qZ84XJBUiGL+HXXckZq+lXmZcYieNFzYtDA= X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00, HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,RDNS_NONE, SPF_HELO_NONE,T_SCC_BODY_TEXT_LINE autolearn=no autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Sat, Apr 2, 2022 at 3:34 PM Sven Peter wrote: > On Tue, Mar 22, 2022, at 14:38, Arnd Bergmann wrote: > > On Mon, Mar 21, 2022 at 5:50 PM Sven Peter wrote: > >> +bad_sgl: > >> + WARN(DO_ONCE(apple_nvme_print_sgl, iod->sg, iod->nents), > >> + "Invalid SGL for payload:%d nents:%d\n", blk_rq_payload_bytes(req), > >> + iod->nents); > > > > I think you mean WARN_ONCE() here? > > This is taken from pci.c which used to use WARN_ONCE but was replaced in > d08774738446e77734777adcf5d1045237b4475a with this construction here. > The commit message mentions > > The WARN_ONCE macro returns true if the condition is true, not if the > warn was raised, so we're printing the scatter list every time it's > invalid. This is excessive and makes debugging harder, so this patch > prints it just once. > Ok, makes sense. If we get more of these in the kernel, we may want to add a helper that makes this more obvious, but it appears that for now these two are the only ones. It could also be expressed by moving the WARN_ONCE() into the condition above the 'goto', but I don't see a reason to change the other driver and it's better to keep the two consistent. > Agreed, I've actually tried replacing all non-relaxed ones with the normal > accessors (even those inside the hot path) and didn't see any performance > difference. > I can use the normal ones here and I'll consider using the non-relaxed ones > in the hot path together with a comment why they are safe in those places. Sounds good. If you find any instances in the hot path that have a corresponding version in the pci.c file, it would be good to keep these two in sync, hopefully making the non-apple case faster as well. Arnd