From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from shelob.surriel.com (shelob.surriel.com [96.67.55.147]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 843C7EE4996 for ; Mon, 21 Aug 2023 14:13:19 +0000 (UTC) Received: from localhost ([::1] helo=shelob.surriel.com) by shelob.surriel.com with esmtp (Exim 4.96) (envelope-from ) id 1qY5ee-0001I0-0a for kernelnewbies@archiver.kernel.org; Mon, 21 Aug 2023 10:13:16 -0400 Received: from mscreen.etri.re.kr ([129.254.9.16]) by shelob.surriel.com with esmtps (TLS1.2) tls TLS_ECDHE_ECDSA_WITH_AES_256_CBC_SHA (Exim 4.96) (envelope-from ) id 1qY5cq-0007jB-1L for kernelnewbies@kernelnewbies.org; Mon, 21 Aug 2023 10:11:25 -0400 Received: from unknown (HELO send002-relay.gov-dooray.com) (211.180.235.153) by 129.254.9.16 with ESMTP; 21 Aug 2023 23:11:10 +0900 X-Original-SENDERIP: 211.180.235.153 X-Original-MAILFROM: ckim@etri.re.kr X-Original-RCPTTO: kernelnewbies@kernelnewbies.org Received: from [10.162.225.112] (HELO smtp002-imp.gov-dooray.com) ([10.162.225.112]) by send002-relay.gov-dooray.com with SMTP id 144c07dc64e3707e; Mon, 21 Aug 2023 23:11:10 +0900 DKIM-Signature: a=rsa-sha256; b=H7NqcrkGFN5qlJqk0lc3TbaeG3m0AMME7IByZTxqsDZcE+FTbIruVsB3/Qtgg8oVHz+OmrWErS eLqPbxIaNYdi1BoZ4AQbUjIkf1DR1PDC1x4uPAt1J7iShSkLmLH5rhBG7r/HmDrBq72JfdESQ1aF 62BLzzzSo3683BBxYuI7SrtNMq5q/gyP92juRsKBoVFO7zC44AGJACYa+VYnlcdvHgchLsikNrFh jUMc8LfAw4ML0Rp23V0hFSHuzFSHnM6qH8fZN2zvHrJQhocWqcYsWNNgvCwbpZ7cScY4Brv46lYS mMb+RuciVjGBPLLnoaFSXq/kr1cuxqSgTO1gEqRA==; c=relaxed/relaxed; s=selector; d=dooray.com; v=1; bh=55TJvheIi0OgNDpuK87kNHno/QSJS3J04D6VGpbfCSg=; h=From:To:Subject:Message-ID; Received: from [129.254.132.39] (HELO CHANKIMPC) ([129.254.132.39]) by smtp002-imp.gov-dooray.com with SMTP id d66c57f764e3707e; Mon, 21 Aug 2023 23:11:10 +0900 From: "Chan Kim" To: Subject: dma_alloc for pcie_device, how can I allocate from the pci device memory? Date: Mon, 21 Aug 2023 23:11:10 +0900 Message-ID: <00e901d9d439$55df6b30$019e4190$@etri.re.kr> MIME-Version: 1.0 X-Mailer: Microsoft Outlook 16.0 Thread-Index: AdnUOSKlK5XML1pATTmk/+goFaPewg== Content-Language: ko X-BeenThere: kernelnewbies@kernelnewbies.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: Learn about the Linux kernel List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Errors-To: kernelnewbies-bounces+kernelnewbies=archiver.kernel.org@kernelnewbies.org Hello all, If you do dma_alloc_xxx for a pci_device, we normally allocate memory in host memory and the IOMMU for the device is setup so that the bus address is converted to host physical memory (or cpu memory). Isn't this right? But how do we allocate memory in the PCI device itself, I mean from the BAR memory address of the pci_device? How do we control from which memory (host memory or PCIe device memory) to allocate memory? Is BAR memory only for explicit allocation by the driver only? Thank you. Chan Kim _______________________________________________ Kernelnewbies mailing list Kernelnewbies@kernelnewbies.org https://lists.kernelnewbies.org/mailman/listinfo/kernelnewbies