Received: by 2002:a05:6a10:206:0:0:0:0 with SMTP id 6csp705468pxj; Fri, 11 Jun 2021 09:24:04 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyfCdHB3WimromBoHHv8clZz9OHFjfA00YQYFr+pG22gnyeEJEyEjPH8/KGNhQOQS6EFOGQ X-Received: by 2002:a17:906:a458:: with SMTP id cb24mr4463284ejb.482.1623428644345; Fri, 11 Jun 2021 09:24:04 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1623428644; cv=none; d=google.com; s=arc-20160816; b=l2kVpRyrJUcX8oFIYCVFBJ3O52bJpuVK5DOTY+rAAR/CDVbtx0gKdrqs3J6bf+TOWr U0cN1fkegVsxYUHi82EmL+JL3OlIXKxyR/66Z677Z1rXqUtjlGqoDR2Zj7JrM75ovrZs YlhzTBpMhicFqnd/gvEAsNTEXY+TiWBXz/ZCk8kBg92MAJbFOb1JUKf8i7ipOS8Zn4Lp XIYyV0yYVMWyovHu8Bw3laNglriRreTFd/bu+4IieooQxBSM4IH9rmiPqZlJKrpYqraC 7o+njuIgm5Ke2ArtH6yh4vfRAHw1rHbMhCmJ/5xsb/E45km+sQHPuOJpO7kVKqnO6bPQ y4qA== 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:dkim-signature; bh=O7VLGpzo0pic/uCZ5FLPezepVfzXChJpgysJmVZaFsc=; b=BzvsihjWXtudEf83+JzvzQvOXwhdyTuCqZoJf3hyQH4ROETbeTuOr/iGEcgq5LAIol nolottJX4k3FlaNt1ktvsIrw6i2MmtcacvTcfY0BJ/igEkQ5xVbH0O1dVna/omQipRXd 0qJXQj/msRakWTnxVf4yUstjYHmSKXKlcayngfUIIsQRm6nu1UgXIToWOXWnWFcGEDyd wHlPmrdrQZnSXh6TOFzaxYqgAHkN0eomGTVdR7/nUzRXAaSuMBRwYtuBLTAz0cQotsoW PkB/PfyQE5OoJKCfoGxmAObp3j0Gd7D+lqf0BkNj1d5eLKiXdtJCF92Ya6nTETNtrkpI 9RCw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linux-foundation.org header.s=google header.b="J/Dt9jQa"; spf=pass (google.com: domain of linux-crypto-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-crypto-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id i17si4915142edc.537.2021.06.11.09.23.34; Fri, 11 Jun 2021 09:24:04 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-crypto-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@linux-foundation.org header.s=google header.b="J/Dt9jQa"; spf=pass (google.com: domain of linux-crypto-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-crypto-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229753AbhFKQYk (ORCPT + 99 others); Fri, 11 Jun 2021 12:24:40 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:51428 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229634AbhFKQYk (ORCPT ); Fri, 11 Jun 2021 12:24:40 -0400 Received: from mail-lf1-x12b.google.com (mail-lf1-x12b.google.com [IPv6:2a00:1450:4864:20::12b]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 159C1C0617AF for ; Fri, 11 Jun 2021 09:22:42 -0700 (PDT) Received: by mail-lf1-x12b.google.com with SMTP id f30so9400916lfj.1 for ; Fri, 11 Jun 2021 09:22:41 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linux-foundation.org; s=google; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=O7VLGpzo0pic/uCZ5FLPezepVfzXChJpgysJmVZaFsc=; b=J/Dt9jQa1QKH8awC7zPDGpIDCC1B4T52bk/xbJkYWmrsyiPBf1xyBpuuJ6YktX8o19 OGXWD4ofRJ+1Y/e3NXpAm87lNARcyx+eUZLb2kGvTbni8Z4d4UmVsZbpfpQ1wYz+9Ynn Tu2YFuveWjy2F/JCy1EWycl4zSkeUBSU/byuI= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=O7VLGpzo0pic/uCZ5FLPezepVfzXChJpgysJmVZaFsc=; b=TwXuIVICd22R/qN57MWlKHqtI+I8mBy/Kd51Fqy/qZxupnPYZEB0oVMqvxgVhBgqVN juvRURSfuoGwsOlheQejl2LaXLJDIN/UjINJpU1eii4IkLo8XETfddEN8S1lUGJF9O2P CTRVDYJuJmxpZrRoLsa23QP3ZS4YfaGCnUMBO33mhzHb1LJBilsE0CillNaCFM1vWDJ5 zCX8/OMEWqmOxQg8AI28ECzxBNJ+BwOLnfId46Gi/xFZF/YRMipxvye/D5BWQYSUqkVu xKpBwpKDSkT6zh7Q/xQnBQPkIRWu8x5xqnjVpldDKJJanLmgYZeIwkETDmMf73nhk5UD 1/BA== X-Gm-Message-State: AOAM531Yej/+6Cqt10BnGr5TFjyB7Qksf5Z66ARHoEe/0rBEc/ggAcH1 YDIpKmv9tbXXsvHkrZF/xi46a0zoTNCZP2zV4b0= X-Received: by 2002:a19:ed04:: with SMTP id y4mr3140783lfy.562.1623428560163; Fri, 11 Jun 2021 09:22:40 -0700 (PDT) Received: from mail-lj1-f172.google.com (mail-lj1-f172.google.com. [209.85.208.172]) by smtp.gmail.com with ESMTPSA id h22sm774252ljk.133.2021.06.11.09.21.59 for (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Fri, 11 Jun 2021 09:22:12 -0700 (PDT) Received: by mail-lj1-f172.google.com with SMTP id r16so10540986ljc.0 for ; Fri, 11 Jun 2021 09:21:59 -0700 (PDT) X-Received: by 2002:a2e:c52:: with SMTP id o18mr3611750ljd.411.1623428518600; Fri, 11 Jun 2021 09:21:58 -0700 (PDT) MIME-Version: 1.0 References: <2e899de2-4b69-c4b6-33a6-09fb8949d2fd@nxp.com> <20210611062153.GA30906@lst.de> In-Reply-To: From: Linus Torvalds Date: Fri, 11 Jun 2021 09:21:42 -0700 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: swiotlb/caamjr regression (Was: [GIT PULL] (swiotlb) stable/for-linus-5.12) To: Konrad Rzeszutek Wilk Cc: Christoph Hellwig , Dominique MARTINET , jianxiong Gao , =?UTF-8?Q?Horia_Geant=C4=83?= , "linux-kernel@vger.kernel.org" , Lukas Hartmann , Aymen Sghaier , Herbert Xu , "David S. Miller" , "linux-crypto@vger.kernel.org" , "iommu@lists.linux-foundation.org" Content-Type: text/plain; charset="UTF-8" Precedence: bulk List-ID: X-Mailing-List: linux-crypto@vger.kernel.org On Fri, Jun 11, 2021 at 3:35 AM Konrad Rzeszutek Wilk wrote: > > Linus, > > Would you be terribly offended if I took your code (s/unsigned > long/unsigned int), and used Chanho's description of the problem (see below)? No offense to that at all - that looks like the right solution. See my answer to Christoph: I do think my patch does the right one, but I can't test it and my knowledge of the swiotlb code is not complete enough to really do anything else than "this looks right". And adding my sign-off to the patch is fine, but I don't necessarily need the authorship credit - mine was a throw-away patch just looking at what the bisection report said. All the real effort was by the reporters (and for the commit message, Bumyong Lee & co). Finally - looking at the two places that do have that swiotlb_align_offset(), my reaction is "I don't understand what that code is doing". The index does that index = find_slots(dev, orig_addr, alloc_size + offset); so that offset does seem to depend on how the find_slots code works. Which in turn does use the same dma_get_min_align_mask() thing that swiotlb_align_offset() uses. So the offsets do seem to match, but find_slots(dev() does a lot of stuff that I don't know. so... IOW, it does reinforce my "I don't know this code AT ALL". Which just makes me more convinced that I shouldn't get authorship of the patch because if something goes wrong with it, I can't help. So at most maybe a "Suggested-by:". My patch really was based on very little context and "this is the calculation that makes sense given the other calculations in the function". Linus