Received: by 2002:a05:6358:a55:b0:ec:fcf4:3ecf with SMTP id 21csp6270413rwb; Wed, 18 Jan 2023 03:20:44 -0800 (PST) X-Google-Smtp-Source: AMrXdXvRB8xOXbc9pW5Pvj/91IRrvt4d/WkC2hBZhck1JGXstK4+TcSbGh60xQKrJ7Zbj+l/Wycb X-Received: by 2002:a05:6a00:f07:b0:58d:a930:e230 with SMTP id cr7-20020a056a000f0700b0058da930e230mr7365236pfb.18.1674040844030; Wed, 18 Jan 2023 03:20:44 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1674040844; cv=none; d=google.com; s=arc-20160816; b=mp/mx/BBO4hlC7/dmGVBrTMPi23kVmptcqzHMh2/l6ik77VNXLWG1m+qDf6DTGaylW GI/NEoTR2NpjnoehrlzUCRL6ofdYjc0azPiE1+ModVxl8LZLMfYVzgvf8/t8678dXjTY YkArYvgrW/ReRdMd+C3ajHXANapnyFFGZW75Cyl07CiAs3MhE8obvp1ziuvLYZK0av8z Ndc3HMhhES2PemI06+YtMOD5it1VqBrPHjfGUwwqy6p65umbaKYTeqDjTDoIyoKweyy4 jd723HjKnl+JFs4ebqnWeARHUy3ufiCcWZfbXj76CKii2dkrKd96OK/+474f2Fy0WrvP SFLQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:in-reply-to:from :references:cc:to:content-language:subject:user-agent:mime-version :date:message-id:dkim-signature; bh=BQeetLMmwhbkZhzTjSGxZuP+z80kL1pLPDlk7u2lHZg=; b=zgVPzuORYOB/KrajsJ/HgVepXDvPTZ5ClicYdWwTMMGihIxNUOM5y+3pFNyNkMwEUt 7TO5UeN8NFFwz+0WzVf5owPVhU4popjr0vnRqyEJTPnGOzCn+uYdPusl0dFhXeIWXKLR Yz+q7rzTaj75/32g0DHc0TQYC37vUk68EJMVhGBmGD/R/coQsInUqPsns9rmtjqzDafS lqdQxv5lLEUB1+wOWe2SXeAC66UYD5Twg0GO6pSxINUpu34mbzys+qcMWQ+rFM0cKjlF Om+XULkdYPh9h/mgCS/uiP9Q1tDx4Hgd9fb0yqqZsSx+uQpOJmkK42XwReR338SGxODf UOcg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@igel-co-jp.20210112.gappssmtp.com header.s=20210112 header.b=FSgocBv0; 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 y71-20020a62644a000000b0058a71b56a06si24042833pfb.130.2023.01.18.03.20.38; Wed, 18 Jan 2023 03:20:44 -0800 (PST) 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=@igel-co-jp.20210112.gappssmtp.com header.s=20210112 header.b=FSgocBv0; 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 S229870AbjARLKr (ORCPT + 47 others); Wed, 18 Jan 2023 06:10:47 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:57388 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230188AbjARLJ7 (ORCPT ); Wed, 18 Jan 2023 06:09:59 -0500 Received: from mail-pg1-x531.google.com (mail-pg1-x531.google.com [IPv6:2607:f8b0:4864:20::531]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 5B6EA5D7CE for ; Wed, 18 Jan 2023 02:17:26 -0800 (PST) Received: by mail-pg1-x531.google.com with SMTP id 141so24168116pgc.0 for ; Wed, 18 Jan 2023 02:17:26 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=igel-co-jp.20210112.gappssmtp.com; s=20210112; h=content-transfer-encoding:in-reply-to:from:references:cc:to :content-language:subject:user-agent:mime-version:date:message-id :from:to:cc:subject:date:message-id:reply-to; bh=BQeetLMmwhbkZhzTjSGxZuP+z80kL1pLPDlk7u2lHZg=; b=FSgocBv044IaFDw+4YBpsothX/Jjz2bDNUQyQoeQjaLaDup0NFBiF9rv/SMfV5zEI0 0e2TKejrMfLgfdrlwrDz9rEuJrYAzVeFhnyYJ6104+Kg4ms6MXiLulPPtbQqhxxy/4Gq h4BtZhuCSfR30G7AUsMnk1ROJzUlTMGy6ehJiaSIQoIE5gpXyOmt/cuqH+7DqagmrIEQ gnjFEFHH6OI79z3eOjRKdP89UFLO3tewz0lGXK6sIxiMCWmDrmJieKTB/nkPW7cJKcK4 5uvcPNTNsc7kUDFoVs3QlR/BDhtLnIpn7WiVKivEa1aR3B9f8T8EakVmTEGd6eOVvdvS VDZA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:in-reply-to:from:references:cc:to :content-language:subject:user-agent:mime-version:date:message-id :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=BQeetLMmwhbkZhzTjSGxZuP+z80kL1pLPDlk7u2lHZg=; b=cGLjDxN2C2xBO6U8dcQL3wCaB60jA62JCM6ObiCinr4oZYXTrf2+siIEf47JRPUrRU QCnKLmn/3NK19zFd/6U9YxdQ/9uiXV6E4scQ3IFZRWRsV4JmRwrLLPnqic4gXfgozvht 2VU9yXBhmfgtnqMcBVwI4FcQHE231bRcP5xcopgxRrIKbaajFELKUkieG63v3wI5cGFK tM83RmwalIbpLtcXvCx7/FJSLqSYFJocne6Ugb8oOaaF1asRrMaerCVimu4IGqFaAj8N 57GLGvZ/wJr8rnpKHdOQmPSni8TVdrmbjxZZZ+owMXOJBhT0EKHNOPNPjdc2lW+CTvzj 9+ZQ== X-Gm-Message-State: AFqh2kqrmO5/tOiTePezT80+aAG24D3ifdNBKzeLJA6zgX621Y88ouwo 731DbiDLMlZeKTPzlPvP8jGyoQ== X-Received: by 2002:a62:6492:0:b0:58d:90ae:495c with SMTP id y140-20020a626492000000b0058d90ae495cmr6366994pfb.11.1674037045841; Wed, 18 Jan 2023 02:17:25 -0800 (PST) Received: from [10.16.128.218] (napt.igel.co.jp. [219.106.231.132]) by smtp.gmail.com with ESMTPSA id u83-20020a627956000000b0058cda506a4fsm7327584pfc.145.2023.01.18.02.17.22 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Wed, 18 Jan 2023 02:17:25 -0800 (PST) Message-ID: <1b26c1e2-62e5-920f-f480-b66b1f903e65@igel.co.jp> Date: Wed, 18 Jan 2023 19:17:21 +0900 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.15; rv:102.0) Gecko/20100101 Thunderbird/102.6.1 Subject: Re: [RFC PATCH 0/3] Deal with alignment restriction on EP side Content-Language: en-US To: Bjorn Helgaas Cc: Jingoo Han , Gustavo Pimentel , Lorenzo Pieralisi , Rob Herring , =?UTF-8?Q?Krzysztof_Wilczy=c5=84ski?= , Bjorn Helgaas , Manivannan Sadhasivam , Kishon Vijay Abraham I , Kunihiko Hayashi , Hou Zhiqiang , Frank Li , Li Chen , linux-pci@vger.kernel.org, linux-kernel@vger.kernel.org References: <20230117203215.GA144880@bhelgaas> From: Shunsuke Mie In-Reply-To: <20230117203215.GA144880@bhelgaas> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit X-Spam-Status: No, score=-2.0 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,NICE_REPLY_A,RCVD_IN_DNSWL_NONE,SPF_HELO_NONE,SPF_PASS 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 On 2023/01/18 5:32, Bjorn Helgaas wrote: > On Fri, Jan 13, 2023 at 06:03:47PM +0900, Shunsuke Mie wrote: >> Some PCIe EPC controllers have restriction to map PCIe address space to the >> local memory space. The mapping is needed to access memory of other side. >> On epf test, RC module prepares an aligned memory, and EP module maps the >> region. However, a EP module which emulate a device (e.g. VirtIO, NVMe and >> etc) cannot expect that a driver for the device prepares an aligned memory. >> So, a EP side should deal with the alignment restriction. >> >> This patchset addresses with the alignment restriction on EP size. A >> content as follows: >> 1. Improve a pci epc unmap/map functions to cover the alignment restriction >> with adding epc driver support as EPC ops. >> 2. Implement the support function for DWC EPC driver. >> 3. Adapt the pci-epf-test to the map/unmap function updated at first patch. >> >> I tested this changes on RENESAS board has DWC PCIeC. >> >> This is a RFC, and it has patches for testing only. Following changes are >> not included yet: >> 1. Removing alignment codes on RC side completely >> 2. Adapting map/unmap() changes to pci-epf-ntb/vntb >> >> Best, >> Shunsuke >> >> Shunsuke Mie (3): >> PCI: endpoint: support an alignment aware map/unmaping >> PCI: dwc: support align_mem() callback for pci_epc_epc >> PCI: endpoint: support pci_epc_mem_map/unmap API changes > s/unmaping/unmapping/ > > Capitalize subject lines ("Support ..."). > > Would be nice to say something more specific than "support ... API > changes." I'll reflect this remarks. > > The last patch seems to be for a test case. Some previous changes to > it use the "PCI: pci-epf-test" prefix so it's distinct from the > pci-epc-core changes. I'll follow the previous changes. >> .../pci/controller/dwc/pcie-designware-ep.c | 13 +++ >> drivers/pci/endpoint/functions/pci-epf-test.c | 89 +++++-------------- >> drivers/pci/endpoint/pci-epc-core.c | 57 +++++++++--- >> include/linux/pci-epc.h | 10 ++- >> 4 files changed, 90 insertions(+), 79 deletions(-) >> >> -- >> 2.25.1 >> Best, Shunsuke