Received: by 2002:a05:6902:102b:0:0:0:0 with SMTP id x11csp2234672ybt; Sun, 21 Jun 2020 13:23:20 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxt8TnuIlP7HwsxNfASilOQnt56S6fKKO0UNvwBezWxkBhxDg0PQjvoXsxCNqQ6yghqpt/1 X-Received: by 2002:a17:906:7f94:: with SMTP id f20mr13443549ejr.394.1592771000625; Sun, 21 Jun 2020 13:23:20 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1592771000; cv=none; d=google.com; s=arc-20160816; b=tkxPJV9TFcC1oDQWMyRtw/sodRyTp2pvNdTfzbvXq/wZNHmiW5b8oiXBwdrsjzYPFF nmZUPTSMm6gb9XgVzm5VHIKWxUqy+xCeK+XROqIjQ7SDQOcHMPoSPlIBptnmBwHGdBzP QW+e7Y9I/D7E/HizWj24JntQQ0pg2lsdgmcTLE/SljYOygdOwCxsjvZkb01wU1D/1E7X KgpK5+JlEaGjEulEDbUHBqWaqOzzfDxJMacfLCKfymPql7ehs6Ns+5G1sO65SB2oAncP JXOmrGEjVb4weiAKFCsN0T7CUiTmvgCFmBaOpXK3qyyGYGz91iVBdLRkiMYiXYtf7K5p BvYw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:mime-version:user-agent:references :message-id:in-reply-to:subject:cc:to:from:date:dkim-signature; bh=LAjnugIsc4VHWdbrPS4xRmq7Vwv6xC2kO9meZ+2Ku74=; b=p9qs1klEFAgkrd41NojmxaFAstzAWEZounRu8bnTUF6vVPDRuIdcOBzZaOnABmeFjx Hooznof/o/TKYrFeomNXYzy0umX3Vf1x0mqObS6+PsCxeti9+jE4DiyQAsa8jl24vU7v W9HwecSruBMSF+50pTUlgafVYMTa/31Qcp0nnGLz3IQAX44UTCL0+Re1xX11LFyoE0md z1Rl6gljgXmrjpA0g92ZDCXf+IEyJ0jNPR9FBvL7mitS7p9nTsnnw9zET7DZCUBS1OP2 cap/Gz4OrwQ1t3BBY7lozRC9M/VfkkEX0zkMt6QZ7YYzWlfZ/LtiYpep/BHpGh6AS7kx t9Sw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@google.com header.s=20161025 header.b=p8GqvDhy; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=google.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id dc26si1107879edb.135.2020.06.21.13.22.57; Sun, 21 Jun 2020 13:23:20 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-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=@google.com header.s=20161025 header.b=p8GqvDhy; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=google.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1730636AbgFUUUi (ORCPT + 99 others); Sun, 21 Jun 2020 16:20:38 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:58758 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1730604AbgFUUUh (ORCPT ); Sun, 21 Jun 2020 16:20:37 -0400 Received: from mail-pg1-x542.google.com (mail-pg1-x542.google.com [IPv6:2607:f8b0:4864:20::542]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 4B136C061794 for ; Sun, 21 Jun 2020 13:20:37 -0700 (PDT) Received: by mail-pg1-x542.google.com with SMTP id e18so7158870pgn.7 for ; Sun, 21 Jun 2020 13:20:37 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20161025; h=date:from:to:cc:subject:in-reply-to:message-id:references :user-agent:mime-version; bh=LAjnugIsc4VHWdbrPS4xRmq7Vwv6xC2kO9meZ+2Ku74=; b=p8GqvDhyZf83WoUCjI4UwDke37CtlmnLL40lIARH49jrrv9ugM7snEa4tgKiLAAwaK 4irrYKWnEO29LpKeNCAeJ4382veELzBbpUlgd4qi7s1/cRGrNz+8zfoBAc431D/cEALq H4a9zUhVG9GkBxhgA+nb9lgX7sJ/7uN9wz908UptIF//PK6D+e1++k2833TGswatuPSM 2hF+Mv9po41cWzhRpqyUP/jZg71colkoyG3xI6h/Xewn12XwcmhIDseu3Jen7PPTRUkD jxRcbwRHRX74QV6gM4Vwk5BGyGHDIIxI+SXT9k/FUKrkuT2Rt2P9HVRuy64WLsIN6/qs iVFw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:in-reply-to:message-id :references:user-agent:mime-version; bh=LAjnugIsc4VHWdbrPS4xRmq7Vwv6xC2kO9meZ+2Ku74=; b=uldt8TeUm8yYBu3Iv4eJmYFY8hBmzBi+fR1qiUfPOFNpALtUPmdU0K9W6jUqVdPE8p fWxwCSAM7jimBt0Dra21V+FG8lRecZayGBxYwnP4QL3bf5ZiCT0SlLatZnaNct+w+jkN uDU3pjK6elGJIDfnF0DfRws49X0rWvGehPs5oQAeZJtg936Q3/gI4YbhgCS3ZNKwj1y3 7I9+9tT5kE189T6eZ67M5HOXx2TlmyOk9R2udssq/R6k411Qnz3Q/DlWiWhBhgj8yC8i uO0Cfg16oavGpFb2FTxJJyAqdCNrGLsSayeEkoJhsYm3NolksrwqBn9PSzvcedTOFAJz aegg== X-Gm-Message-State: AOAM530CegsDcC+OYQzN5HuLLWisty2PSaiJPjmeZ0HEU6TY1A/i2oj/ UjjrKg8cZm7yrNe8/UJYfx+VCg== X-Received: by 2002:a05:6a00:1592:: with SMTP id u18mr17298748pfk.26.1592770836678; Sun, 21 Jun 2020 13:20:36 -0700 (PDT) Received: from [2620:15c:17:3:3a5:23a7:5e32:4598] ([2620:15c:17:3:3a5:23a7:5e32:4598]) by smtp.gmail.com with ESMTPSA id y3sm12039140pff.37.2020.06.21.13.20.35 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 21 Jun 2020 13:20:36 -0700 (PDT) Date: Sun, 21 Jun 2020 13:20:35 -0700 (PDT) From: David Rientjes X-X-Sender: rientjes@chino.kir.corp.google.com To: Guenter Roeck cc: Geert Uytterhoeven , Christoph Hellwig , Marek Szyprowski , Robin Murphy , Linux IOMMU , Linux Kernel Mailing List Subject: Re: [PATCH v2] dma-pool: Fix too large DMA pools on medium systems In-Reply-To: Message-ID: References: <20200608132217.29945-1-geert@linux-m68k.org> <20200620200936.GA106151@roeck-us.net> User-Agent: Alpine 2.22 (DEB 394 2020-01-19) MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Sun, 21 Jun 2020, Guenter Roeck wrote: > >> This patch results in a boot failure in some of my powerpc boot tests, > >> specifically those testing boots from mptsas1068 devices. Error message: > >> > >> mptsas 0000:00:02.0: enabling device (0000 -> 0002) > >> mptbase: ioc0: Initiating bringup > >> ioc0: LSISAS1068 A0: Capabilities={Initiator} > >> mptbase: ioc0: ERROR - Unable to allocate Reply, Request, Chain Buffers! > >> mptbase: ioc0: ERROR - didn't initialize properly! (-3) > >> mptsas: probe of 0000:00:02.0 failed with error -3 > >> > >> Configuration is bamboo:44x/bamboo_defconfig plus various added drivers. > >> Qemu command line is > >> > >> qemu-system-ppc -kernel vmlinux -M bamboo \ > >> -m 256 -no-reboot -snapshot -device mptsas1068,id=scsi \ > >> -device scsi-hd,bus=scsi.0,drive=d0,wwn=0x5000c50015ea71ac -drive \ > >> file=rootfs.ext2,format=raw,if=none,id=d0 \ > >> --append "panic=-1 slub_debug=FZPUA root=/dev/sda mem=256M console=ttyS0" \ > >> -monitor none -nographic > >> > >> canyonlands_defconfig with sam460ex machine and otherwise similar command line > >> fails as well. > >> > >> Reverting this patch fixes the problem. > > > > This looks like the minimum value of 128 KiB is not sufficient, and the > > bug is in the intention of 1d659236fb43c4d2 ("dma-pool: scale the > > default DMA coherent pool size with memory capacity")? > > Before, there was a single pool of (fixed) 256 KiB size, now there are > > up to three coherent pools (DMA, DMA32, and kernel), albeit of smaller > > size (128 KiB each). > > > > Can you print the requested size in drivers/message/fusion/mptbase.c: > > PrimeIocFifos()? > > 172928 bytes > > > Does replacing all SZ_128K by SZ_256K in my patch help? > > Yes, it does. > The new coherent pools should auto expand when they are close to being depleted but there's no guarantee that it can be done fast enough. Switching the min size to be the previous min size (256KB) seems like the best option and it matches what Documentation/admin-guide/kernel-parameters.txt still stays. I'll also send a patch to point in the right direction when this happens.