Received: by 2002:a05:6358:45e:b0:b5:b6eb:e1f9 with SMTP id 30csp153373rwe; Tue, 30 Aug 2022 23:40:23 -0700 (PDT) X-Google-Smtp-Source: AA6agR6aiypjt2uqd51kqfOyJ8EbS5VoIPt7TfivJM0K4q6CL4qYKQlL4N64GNGVp8t2ADu2Fuqa X-Received: by 2002:a05:6402:3546:b0:43e:466c:d4ed with SMTP id f6-20020a056402354600b0043e466cd4edmr23547648edd.48.1661928022840; Tue, 30 Aug 2022 23:40:22 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1661928022; cv=none; d=google.com; s=arc-20160816; b=BeplNT/bvQIq4vRKfiN5ekMRlWz6PdB2wndN69/SCw4m79VGvf+OAnC7v43excm9aW ILXMEBh9skJ8cNfDelBeppQ6K5z74R4QxaJ37c5FcqF/LaUR7nqYa3UrEdBauCyve02l udFe5j+m4SeTGyjDNmzI+is0EalrQM8TBl4VF0fKlLpHBJZEE4MXOKvY/QLNERH5IsJv nuLA/nYcJXpAafDfnCh59Tzy160mXgco0/t0V1D2of/yM99ump4nKo7jQjDt+woca7se M85NeBAmEqpshnj7Yb7jFND/JOxiF9p5QXE5TXSFcabK4OOVosMbip4hywCutQ6cCvWr uCVA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:cc:to:from:subject:references:mime-version :message-id:in-reply-to:date:dkim-signature; bh=It3y/STunI05Ydz1QHfujdG313dUyBru08R+qGI7HoM=; b=Oo/rxWboJZmha3vOA+d7hg8saebxr4wcEOI1ALuL1rx4JyLBDG9T90U0HrGHxq3Ak/ ziSl7l5SgU7v2k89FywMNoS5Vn2Dm0/QJlv6PY5dYD+EwHvox+Z6z13WUD5RU7KxCVRU KHnChGYvP/3TwQqtLGwjB/QAnwuWjHiRZs3sOdmxhkOXszcY4/6kBZtw93sWWdBck4Cq rKaTp6oTSNPW14o2WzYBrPL6MCgiZGpPcpgts4Ju2f1Uk3UYYYkpyQeyBRHFi5Wke8zK LNhDonsIjGTIoxDsALrW2p5mLC9LCjagC8TVAnczl1SSC+DgbsZrMcdPxqMhzZq0gLsP qZXw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@google.com header.s=20210112 header.b="bA2Qx/GQ"; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 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 out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id z9-20020a1709060be900b0072eece129bdsi9430354ejg.59.2022.08.30.23.39.54; Tue, 30 Aug 2022 23:40:22 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@google.com header.s=20210112 header.b="bA2Qx/GQ"; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 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 S230235AbiHaGiZ (ORCPT + 99 others); Wed, 31 Aug 2022 02:38:25 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:34630 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229870AbiHaGiX (ORCPT ); Wed, 31 Aug 2022 02:38:23 -0400 Received: from mail-yw1-x114a.google.com (mail-yw1-x114a.google.com [IPv6:2607:f8b0:4864:20::114a]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 5BD33BD75A for ; Tue, 30 Aug 2022 23:38:22 -0700 (PDT) Received: by mail-yw1-x114a.google.com with SMTP id 00721157ae682-33ef3e5faeeso190998247b3.0 for ; Tue, 30 Aug 2022 23:38:22 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20210112; h=cc:to:from:subject:references:mime-version:message-id:in-reply-to :date:from:to:cc; bh=It3y/STunI05Ydz1QHfujdG313dUyBru08R+qGI7HoM=; b=bA2Qx/GQl3M3N9A8PUFo9hekqjnouCvqIFiijACBUirMx/DolZPyJR/G96OVlAoZkj taUpfJ8birvC5nERsAybS7mclQxIjcWwrUWZOj+hJyyCZ6fGo8Yo43RCreFN7/wWBxIM kOUrZJLrLLNG27GYus10Nrns978dPi93yD801SyYNRSqnoamewGNGufUej0g/mqncUrR PkcAAmyK9RUfYVjqPOFankeGldXgjIbxLQpFy9Fk8BRAHLZeDVbG+oUnOX1Za0yM2elK XoeNhV6Ui6e1NIg1hvb/WA7uTXfxmfZnl2z7uyKEi+AItM2ctv5piL6UBvhcbQNfaj6A 43kQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=cc:to:from:subject:references:mime-version:message-id:in-reply-to :date:x-gm-message-state:from:to:cc; bh=It3y/STunI05Ydz1QHfujdG313dUyBru08R+qGI7HoM=; b=te7I2UOJsGDYIXNydG8j5BjsLJq0MTfenwfcCaVW6Wp0Agy8uU2GB7aGmIG4yzMXSV 9DOuCEBZUS898IXdUHj+bI2uTGf7E6cLbXnjsH2W5WdiEPPzTsGpjEEVBDtbm7VEQUzc ZIW2FxZmBqAlaKpxVfXbZP6wXB89D3I0ZRdI4LbibYAvN+hxG0uwZdXIR0GmdnkuTRix hAtopPb33//F7Y2OQs2pZxSR9V9Uan5eGDeFUabrPGt/Oi7cYCSQsVnPPCFBx7+UM9ek 7zdBUfcuYmNrrJqI9f0hihBy4lDX3hwTFT6VPfAyvs9x61OoxzdZoTlqj8SY/oEIkBFS kFBQ== X-Gm-Message-State: ACgBeo15clX50cHe80dVuYXgxe3sX6apLrTfZhZLmkPqILqftx0ocCnw mQMqBKc4qfg61Bxt3h+1L6eQwjz5uxA= X-Received: from yuzhao.bld.corp.google.com ([2620:15c:183:200:103:daa9:a72c:751a]) (user=yuzhao job=sendgmr) by 2002:a5b:3ce:0:b0:66f:4692:27a2 with SMTP id t14-20020a5b03ce000000b0066f469227a2mr14479161ybp.167.1661927901645; Tue, 30 Aug 2022 23:38:21 -0700 (PDT) Date: Wed, 31 Aug 2022 00:38:18 -0600 In-Reply-To: <20220829232934.3277747-1-yuzhao@google.com> Message-Id: <20220831063818.3902572-1-yuzhao@google.com> Mime-Version: 1.0 References: <20220829232934.3277747-1-yuzhao@google.com> X-Mailer: git-send-email 2.37.2.672.g94769d06f0-goog Subject: [PATCH v2] Revert "swiotlb: panic if nslabs is too small" From: Yu Zhao To: Christoph Hellwig , Marek Szyprowski , Robin Murphy , Dongli Zhang Cc: iommu@lists.linux.dev, linux-mips@vger.kernel.org, linux-kernel@vger.kernel.org, Yu Zhao , kernel test robot , Dan Carpenter Content-Type: text/plain; charset="UTF-8" X-Spam-Status: No, score=-9.6 required=5.0 tests=BAYES_00,DKIMWL_WL_MED, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_NONE, SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE,USER_IN_DEF_DKIM_WL autolearn=ham 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 This reverts commit 0bf28fc40d89b1a3e00d1b79473bad4e9ca20ad1. Reasons: 1. new panic()s shouldn't be added [1]. 2. It does no "cleanup" but breaks MIPS [2]. v2: properly solved the conflict [3] with commit 20347fca71a38 ("swiotlb: split up the global swiotlb lock") Reported-by: kernel test robot Reported-by: Dan Carpenter [1] https://lore.kernel.org/r/CAHk-=wit-DmhMfQErY29JSPjFgebx_Ld+pnerc4J2Ag990WwAA@mail.gmail.com/ [2] https://lore.kernel.org/r/20220820012031.1285979-1-yuzhao@google.com/ [3] https://lore.kernel.org/r/202208310701.LKr1WDCh-lkp@intel.com/ Fixes: 0bf28fc40d89b ("swiotlb: panic if nslabs is too small") Signed-off-by: Yu Zhao --- kernel/dma/swiotlb.c | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/kernel/dma/swiotlb.c b/kernel/dma/swiotlb.c index c5a9190b218f..dd8863987e0c 100644 --- a/kernel/dma/swiotlb.c +++ b/kernel/dma/swiotlb.c @@ -326,9 +326,6 @@ void __init swiotlb_init_remap(bool addressing_limit, unsigned int flags, swiotlb_adjust_nareas(num_possible_cpus()); nslabs = default_nslabs; - if (nslabs < IO_TLB_MIN_SLABS) - panic("%s: nslabs = %lu too small\n", __func__, nslabs); - /* * By default allocate the bounce buffer memory from low memory, but * allow to pick a location everywhere for hypervisors with guest @@ -341,8 +338,7 @@ void __init swiotlb_init_remap(bool addressing_limit, unsigned int flags, else tlb = memblock_alloc_low(bytes, PAGE_SIZE); if (!tlb) { - pr_warn("%s: Failed to allocate %zu bytes tlb structure\n", - __func__, bytes); + pr_warn("%s: failed to allocate tlb structure\n", __func__); return; } base-commit: dcf8e5633e2e69ad60b730ab5905608b756a032f -- 2.37.2.672.g94769d06f0-goog