Received: by 2002:a6b:fb09:0:0:0:0:0 with SMTP id h9csp452735iog; Wed, 15 Jun 2022 05:50:20 -0700 (PDT) X-Google-Smtp-Source: AGRyM1sMQpWanEdMuQFBojG4GacldFwzegCBBVq9wCG1wENHOXSvWxXqkerqdHgxbunSWB4jEmhN X-Received: by 2002:a05:6a00:1ad4:b0:51c:7852:2bd1 with SMTP id f20-20020a056a001ad400b0051c78522bd1mr9640865pfv.2.1655297419973; Wed, 15 Jun 2022 05:50:19 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1655297419; cv=none; d=google.com; s=arc-20160816; b=IbhP2xInuK3OAu8+pn1L2lMh1CuBEMzj5zcNCZ2ZM0FjdWMVBIrhgKdSZ8NVT8Bv6S LLHFJUSvV7kNL0Su7J8+kaCo+gJXGYGyTwiKvBkWBj6bZxJYrvbKIx7UiU+zaVGmvKG9 VSXiqYGWuDTnn09sqFgeG51/Tw0Hj70SoK7FcUNvt5Q1mizNSPu9XJnFPH6F2POUBv5i HHCF8Cv5ruZuwKF4+SBud7Ygor9U3fWeC2l1JNKmatjxeJXjDBojuZfSLUV0/OkNi7Uz 7ivbOZA/3yX/bUp4e6+pwJFnniNVuQEHrEevSoXxOK37+jnYk632LKT9n9QLIgsqsanO D9hw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sensitivity:importance:date:subject:to:from :message-id:mime-version:dkim-signature; bh=ezOnlosGKAAydv3zO7jEy12Plio79ZRPNcLr5oCfANk=; b=NhN523ZDjAmB/k71MHMAuPpC8/gqTtsydaLsAWzbC9BoD+Orocn05pmfqKFujdh6U1 nTAjfn3OZSUrNkx0z0b2k3U6Q+0z2EkLRot0JkyM9GXxvr3pZKHDJLohPIs9lvmxol9W FIE2wPYUGb8UWojB4ZARuxWXGqsYfpmmh7JWnz3/D0xKej8HK11fovOFEy1j2dL+dQ// Vm7s8u8QeYVITujntcoDJEJlghHgzi9wnjW87ivDk4Jcw4dB61R12apBR0Fw92AEGfF7 YlGmKdnErItDTc9MB9HiphOAyDx7yq2dpUn1O5lK1JOxDDDL4xTVKY30/jhMu40bxuBX MCiw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmx.net header.s=badeba3b8450 header.b=eVdRi8NF; 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 Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id h9-20020a170902f70900b00161558a437fsi16921205plo.160.2022.06.15.05.50.06; Wed, 15 Jun 2022 05:50:19 -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=@gmx.net header.s=badeba3b8450 header.b=eVdRi8NF; 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1344768AbiFOMLN (ORCPT + 99 others); Wed, 15 Jun 2022 08:11:13 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:42772 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S237334AbiFOMLL (ORCPT ); Wed, 15 Jun 2022 08:11:11 -0400 Received: from mout.gmx.net (mout.gmx.net [212.227.17.22]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 166434ECC7 for ; Wed, 15 Jun 2022 05:11:09 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=gmx.net; s=badeba3b8450; t=1655295061; bh=ezOnlosGKAAydv3zO7jEy12Plio79ZRPNcLr5oCfANk=; h=X-UI-Sender-Class:From:To:Subject:Date; b=eVdRi8NFzgZMhvm39tOzsTq+7RInziJqqsZw1cO2ZjhlsCdmKpkSERmH3gn4obWak oo/phsUoH/37hA4AD1+6e9EssAMqC3kziu+K/ja2qbHIb+ZYDsyVwHorJHh2V/KMo6 9VwTNjHUKRYRbEG95DLL8bN9A+q/dhpXgYNI947s= X-UI-Sender-Class: 01bb95c1-4bf8-414a-932a-4f6e2808ef9c Received: from [217.61.154.5] ([217.61.154.5]) by web-mail.gmx.net (3c-app-gmx-bap28.server.lan [172.19.172.98]) (via HTTP); Wed, 15 Jun 2022 14:11:01 +0200 MIME-Version: 1.0 Message-ID: From: Frank Wunderlich To: linux-kernel@vger.kernel.org, iommu@lists.linux-foundation.org, Robin Murphy , Marek Szyprowski , Christoph Hellwig Subject: helping with remapping vmem for dma Content-Type: text/plain; charset=UTF-8 Date: Wed, 15 Jun 2022 14:11:01 +0200 Importance: normal Sensitivity: Normal X-Priority: 3 X-Provags-ID: V03:K1:prJPJkK3LsA2dyv/B4CgBXInvxwhazHL2+i4NT5HILEb0X3vFX2cw2FHYhNF3WSJuZ6Dh jhmKjare/8EgAott0Sca5YAcM35WB3vvDVwE2cfCmpzzTqusTiZ8Zq6eDILWAG17d/5G/fsnZ586 I8jgOiDFMu6lr/hfrSGxg4/f5ZKAMzmBzODiFRIN5igr7MtzHmHpB68fiJL+gz+YfHZ6guHCqJCt DeIXT4zSWnkGfa+akDLPrXRo96raafEoUrhBhKIqJQctZiu4ENZZ0BNQLtNjc8xroQHqEW+1ONgF tg= X-UI-Out-Filterresults: notjunk:1;V03:K0:I5EpnuWbdMs=:ufROBBNVL+7PfkfwLzSBOr 2RuWzvzA64Ae3f+/XuatqJmvz620Weh1IefvrkyIXvyLA67qUtJtiVDfEaX6LnTAp/xQ5g6GM rDiZ3XjUikldjRPWTvVB/7skxGqu5tq5Z4KNloGhXyDeeDhaZAih8X74pbBzN5yB0BN4Om8Ja lxCSTBk+uVVp2AUXE/jz4+7tZVF1vZ+DTx7Pqr3Yqo3rfgcRmqDxemgPtAF0T+nQ1YreojLTT OU1AtRFpEXZF4A7O8rD5t9ahaB1Gk1+pPAT7xroPav7RXihvjRR1Etef8H9f6eVmp33Xve2kQ lX3Eo1y0CUYkWyz+Vx+BOe2XAX/E//9nqmh9lXnxFqVpZ5TYsC+2rwVkMApcOLwb2qXMoMK1M 8T2GmMDA4srPiO7kRGSS2zQa8NKe1I6Lpf72iYRGEBStv3dZU3CfiMqQpSvdqYqZyorWZ8d9k TVcKlTvNOLGbm6ol2prRUXGuUPHNw0lML1K+Mo1A4v3SAPF/7Q+Ps9bOO9Rs6/uZNM+Ua1NT+ nmOurj7u4hrtjoMS15LiTBjHk42SV168r421WfclqUEbQ5FlAUibXEsH3LHO11B84p5Yp8lV2 Zw6lyCNJqOmsQtFVXUN1nhrnASqwwaYAr/qBm+a+VnY+HEEd389u5lfSn0c8k/GqOK4P5ucI1 IVf0Y3kf9Z/iKbNpN2LiCivRaf3QI5jjmrg0QH62vivEofrM+hEkt4TOh6GRcp5Td6gaAxMK1 lEqZvgIi30Com2Imo/i7oYn4mY6kevap9kufnW/J5BiektwbyYNGhHHYpxRL5wr/drF4ILsMI J8k0Nbb X-Spam-Status: No, score=-2.6 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,RCVD_IN_DNSWL_LOW,RCVD_IN_MSPIKE_H2,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 Hi, i have upported a wifi-driver (mt6625l for armhf) for some time and fall now (at least 5.18) in the "rejecting DMA map of vmalloc memory" error [1]. maybe anybody here can guide me on how to nail it down and maybe fix it. as far as i have debugged it, it uses dma_map_single [2] to get dma memory from a previous allocated memory region. this function "kalDevPortRead" in [2] is used via macro HAL_PORT_RD [3] (used in HAL_READ_RX_PORT and HAL_READ_INTR_STATUS in same hal.h file) HAL_READ_INTR_STATUS is always called with an empty int array as buf which i guess is not the problem. I think the issue is using the use with an preallocated prSDIOCtrl struct (have not completely traced it back where it is allocated). calls of HAL_PORT_RD/HAL_READ_RX_PORT are in nic{,_rx}.c (with sdio-struct) ([4] as example) maybe there is a simple way to get an address in preallocated memory as replacement for the dma_map_simple call (and the unmap of course). regards Frank [1] https://elixir.bootlin.com/linux/latest/source/include/linux/dma-mapping.h#L327 [2] https://github.com/frank-w/BPI-R2-4.14/blob/5.18-main/drivers/misc/mediatek/connectivity/wlan/gen2/os/linux/hif/ahb/ahb.c#L940 [3] https://github.com/frank-w/BPI-R2-4.14/blob/5.18-main/drivers/misc/mediatek/connectivity/wlan/gen2/include/nic/hal.h#L176 [4] https://github.com/frank-w/BPI-R2-4.14/blob/5.18-main/drivers/misc/mediatek/connectivity/wlan/gen2/nic/nic_rx.c#L3604