Received: by 2002:a05:6358:5282:b0:b5:90e7:25cb with SMTP id g2csp3412373rwa; Tue, 23 Aug 2022 04:28:35 -0700 (PDT) X-Google-Smtp-Source: AA6agR5X8sOA1HirWfHEd9f6yEQ5DtPpdH/1DfcZ06AVmcIXQmgOOPCGYgobtl7AYV+euxa1m/6R X-Received: by 2002:a63:4c50:0:b0:429:983d:22f1 with SMTP id m16-20020a634c50000000b00429983d22f1mr20405414pgl.213.1661254115577; Tue, 23 Aug 2022 04:28:35 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1661254115; cv=none; d=google.com; s=arc-20160816; b=SG0FpXv8UGV4QPaomE91825y1v//2NggxO+63rTbtQ/sdQ8BRfEFO0Akl2KkXJYIw6 nkk3HfveYMbB26QNMthgIE3l/O9ejckMsCx7gsbzBrjo5V9ysB06qluYY07aZnoRqs7A wZXoJOLD89lxXMG4WeZUI5+T8F5APLy0NDwPGQBBbrhPX0S19xjZ3xMiafYbFfNXGtt2 T1ivkoQB5nXSofB+IU+X6tOoc4/XEQTZ0royvtIkGIkhVKgHgxl4YNgUD7Yo0/AG3g8/ zUTwyqMMYqq0nc7qsXdx9LIUYZupo7b/uTMHDXrBF1/7dPItka+qP3becNqoRsZ9NHas WUhw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=SXXHufbjxGiu0F9SUBXyplSeQ9atmrUB+tZQHFUghZA=; b=NOih+h7V9dTp8QMF5EixJi1YdULaod9cxUZBZV61NJ2s7NBQsDyzSBhb4UagVNLput v1AqOpoaUzKbmg0mJ2/GwwANnw/KpXmmeCJ5SaSh9VGjhjnutb/yEKepieCURf5QgVk3 gqcDi1X1vheckSXGB7ExY4deYRRDBbi0+XD1A2BGTSmA6rtr70LAi+VASSlMZ+n+v3db 3kS71SOb4A6T1B3lU9Ks6VAM6cAu0+mPha53K0VJSJ8u3Zn+j2sfjq/qjeYrmsAy5DuL z5YbS1tmnap58Sbka2h7KsKAiDHrVaKEkFWDxmiEHFeNPE5lH+pFmCnKZHv2qOvDhSNG dSdQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=OAxw3v96; 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=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id k17-20020a170902ce1100b0017145b821d2si14715721plg.477.2022.08.23.04.28.22; Tue, 23 Aug 2022 04:28:35 -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=@linuxfoundation.org header.s=korg header.b=OAxw3v96; 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=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1353806AbiHWKTR (ORCPT + 99 others); Tue, 23 Aug 2022 06:19:17 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:35636 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1352668AbiHWKIZ (ORCPT ); Tue, 23 Aug 2022 06:08:25 -0400 Received: from ams.source.kernel.org (ams.source.kernel.org [IPv6:2604:1380:4601:e00::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id D65CD58DF8; Tue, 23 Aug 2022 01:54:40 -0700 (PDT) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ams.source.kernel.org (Postfix) with ESMTPS id 83585B81C3B; Tue, 23 Aug 2022 08:54:39 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id D4ADAC433C1; Tue, 23 Aug 2022 08:54:37 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1661244878; bh=SAvOhlafPdoVmoH3guJYuNfZGMfWY3Q8a+8odAousBE=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=OAxw3v96oHkBNpr+Km3tCPQ+WoO0MOZtn6JvNAEPCKSousg1IKl1+orLEF5JyMr65 WQOT6xH5dD8S1lqQvdWodZe8cgNz+3LANe/xN7QO2Sun8lE4kD0ERGcUyoKti3FRIv XJ1DgExJh/hh4qjecCjCX8bJa3+f23spuSZYkWnk= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Frank Li , Sasha Levin Subject: [PATCH 5.15 166/244] usb: cdns3: fix random warning message when driver load Date: Tue, 23 Aug 2022 10:25:25 +0200 Message-Id: <20220823080104.757719724@linuxfoundation.org> X-Mailer: git-send-email 2.37.2 In-Reply-To: <20220823080059.091088642@linuxfoundation.org> References: <20220823080059.091088642@linuxfoundation.org> User-Agent: quilt/0.67 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-7.1 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_HI, SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE 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 From: Frank Li [ Upstream commit 8659ab3d936fcf0084676f98b75b317017aa8f82 ] Warning log: [ 4.141392] Unexpected gfp: 0x4 (GFP_DMA32). Fixing up to gfp: 0xa20 (GFP_ATOMIC). Fix your code! [ 4.150340] CPU: 1 PID: 175 Comm: 1-0050 Not tainted 5.15.5-00039-g2fd9ae1b568c #20 [ 4.158010] Hardware name: Freescale i.MX8QXP MEK (DT) [ 4.163155] Call trace: [ 4.165600] dump_backtrace+0x0/0x1b0 [ 4.169286] show_stack+0x18/0x68 [ 4.172611] dump_stack_lvl+0x68/0x84 [ 4.176286] dump_stack+0x18/0x34 [ 4.179613] kmalloc_fix_flags+0x60/0x88 [ 4.183550] new_slab+0x334/0x370 [ 4.186878] ___slab_alloc.part.108+0x4d4/0x748 [ 4.191419] __slab_alloc.isra.109+0x30/0x78 [ 4.195702] kmem_cache_alloc+0x40c/0x420 [ 4.199725] dma_pool_alloc+0xac/0x1f8 [ 4.203486] cdns3_allocate_trb_pool+0xb4/0xd0 pool_alloc_page(struct dma_pool *pool, gfp_t mem_flags) { ... page = kmalloc(sizeof(*page), mem_flags); page->vaddr = dma_alloc_coherent(pool->dev, pool->allocation, &page->dma, mem_flags); ... } kmalloc was called with mem_flags, which is passed down in cdns3_allocate_trb_pool() and have GFP_DMA32 flags. kmall_fix_flags() report warning. GFP_DMA32 is not useful at all. dma_alloc_coherent() will handle DMA memory region correctly by pool->dev. GFP_DMA32 can be removed safely. Signed-off-by: Frank Li Link: https://lore.kernel.org/r/20220609154456.2871672-1-Frank.Li@nxp.com Signed-off-by: Greg Kroah-Hartman Signed-off-by: Sasha Levin --- drivers/usb/cdns3/cdns3-gadget.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/usb/cdns3/cdns3-gadget.c b/drivers/usb/cdns3/cdns3-gadget.c index 4bcaed787c0f..3f1ce8911077 100644 --- a/drivers/usb/cdns3/cdns3-gadget.c +++ b/drivers/usb/cdns3/cdns3-gadget.c @@ -220,7 +220,7 @@ int cdns3_allocate_trb_pool(struct cdns3_endpoint *priv_ep) if (!priv_ep->trb_pool) { priv_ep->trb_pool = dma_pool_alloc(priv_dev->eps_dma_pool, - GFP_DMA32 | GFP_ATOMIC, + GFP_ATOMIC, &priv_ep->trb_pool_dma); if (!priv_ep->trb_pool) -- 2.35.1