Received: by 2002:a05:6358:11c7:b0:104:8066:f915 with SMTP id i7csp5757615rwl; Tue, 4 Apr 2023 03:15:28 -0700 (PDT) X-Google-Smtp-Source: AKy350anO9jxa8vVZOAdCcZ4Qgyg8oby9nbCDm66KRg/v947PCEDaAPhQBy/SmmnzVG47x2lI4XK X-Received: by 2002:a62:1d8f:0:b0:627:e577:4326 with SMTP id d137-20020a621d8f000000b00627e5774326mr1623337pfd.17.1680603327757; Tue, 04 Apr 2023 03:15:27 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1680603327; cv=none; d=google.com; s=arc-20160816; b=xVQlRRhQ2cIomVLVLQlIQKu7A3clYWdWgG5FFeo8y8gUkO10KkTxPK7KIdMrbVJAzU jM/uYarEaAl94L4WUwQW8QSwNo97vLDuQrN1IwQw76M2Xvwz4AsGs4giG3pSwucTq6OD r4k4aoehiYPH3/wULrSYXijD6tTVjY0xEdoqizz2FYL/RzXrMT36In5aVPVSiV86m0PD i5avrnNGG4weFeO2Jk1HQp6TdkyXWRya4Fc7Aj2N9IHuo2SZdq1X8TnTITLeVCFTQEMC saHXJ0ErfkNa+0vwELD04WKojmOJumIkme7TyyQndyl9XsO3u7xHLsOl8ZHQwiL8Xheq VxQg== 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=H1nFAdUtaNleNvdd4R9u83gwyhhW/N23uXd1WaMTM4U=; b=K97cdIblVSb+3sCc3OJ4B7nXtwJjw9OJhvIuD0bM9Ck4C3wIe6qcEEZ1/Fp/8rhj1x gbpCNqiZglg+AVjypTPbkeQKmrp4Br8M0W06fCo3TC25fGCYkUm68gCZr3tewOwKxVEx el1m6fDZn0ToYJ8lexLsV48rd2RqsHYvA36RmWEvE2oduI74soo69R8PC507WPh2sNAu bBetZPe8FSdWCnqO2yG0VUrBDDbr7Yh44+E3hKoYi39oBdMJIBlY3GA3x090LA9SWisC 8VGUeplIVMH8zf3oW3lUjs8EJtzjDbWVC9g7uHMl12KD8gCWmHCBL29bdMtQfqx5Lkra Va7w== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@igel-co-jp.20210112.gappssmtp.com header.s=20210112 header.b=syseZK3D; 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 y9-20020aa79429000000b006280cd49406si10463181pfo.249.2023.04.04.03.15.15; Tue, 04 Apr 2023 03:15:27 -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=@igel-co-jp.20210112.gappssmtp.com header.s=20210112 header.b=syseZK3D; 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 S234442AbjDDKMZ (ORCPT + 99 others); Tue, 4 Apr 2023 06:12:25 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:42704 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S234412AbjDDKMT (ORCPT ); Tue, 4 Apr 2023 06:12:19 -0400 Received: from mail-pj1-x102b.google.com (mail-pj1-x102b.google.com [IPv6:2607:f8b0:4864:20::102b]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 419DF30C5 for ; Tue, 4 Apr 2023 03:12:00 -0700 (PDT) Received: by mail-pj1-x102b.google.com with SMTP id mp3-20020a17090b190300b0023fcc8ce113so35566185pjb.4 for ; Tue, 04 Apr 2023 03:12:00 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=igel-co-jp.20210112.gappssmtp.com; s=20210112; t=1680603120; 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=H1nFAdUtaNleNvdd4R9u83gwyhhW/N23uXd1WaMTM4U=; b=syseZK3DkzUTu4rg9+gE6qvvj6nkt4Um45ZGqGK1w3ujhwuOfepRvk0YR7dYLzxOU8 CdCi8QeP0v0n1rqRzRvN312AW5p6AV7xa9e5gggxbZh4wt8QHtOrnme2BluEspcFyv+o rCCL8n3v/vW6kofNuIFITWRyEfc07xCBJhqVKFcew2eAZsntybVtOP5Kb59iMY6yzAzD Hbc1GUwymQvu7br9rT8i/sb8WUYoEY17Wwc2lv2uu0LJDw5i5wJSQx4sG3+0Cd40wgP6 Pv1xHnF4QS7Rfs2dxcKgat/Xu9N6dY4i33A+5E55dLFS7ijmJx1xLzkfd/x4Uh0q4XGl 7qUQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; t=1680603120; 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=H1nFAdUtaNleNvdd4R9u83gwyhhW/N23uXd1WaMTM4U=; b=nMGxTGFtXWXxkFRVVR6iR5MqzSYNhc6a7DOa7MKJC/ICOtYCw8HRPbXMOXP+0JpgIv gOUkNFpyCSpu6f1iyzTE29SNtBG5Ax+/o1QoOr2N0m6Yhoz8vXKOycx1Fyh0Kf2vaMTU nXozuQo7MIexFqvbg4uWPGeS3OJACJRNoOQdqVQc+97qk9qwEOccDkCVoM0B61NDHknX PIPFLWzmudyYzJPhUqZKCNYXBVK86FDujmBaKJNacie/RfCQfx2HtMjMFe64o+tTXnrL 0R/xhYZG0Ko02WhjSk79i/Zh6/+hm/enGF7tag66NyDbcTOx+M+l7HfisSCaQ6kKZYp3 aMAA== X-Gm-Message-State: AAQBX9fl1pOo6Fq/9jNwmRTu9QkO9WIH/suPBHpn+uDbGZdwx/rFXaty sMi5QXNSjsvYcg+cy3e1HN7qUg== X-Received: by 2002:a17:902:d193:b0:1a2:73d8:5a87 with SMTP id m19-20020a170902d19300b001a273d85a87mr1760672plb.5.1680603119682; Tue, 04 Apr 2023 03:11:59 -0700 (PDT) Received: from [10.16.161.199] (napt.igel.co.jp. [219.106.231.132]) by smtp.gmail.com with ESMTPSA id az3-20020a170902a58300b001a281063ab4sm8014999plb.233.2023.04.04.03.11.56 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Tue, 04 Apr 2023 03:11:59 -0700 (PDT) Message-ID: <2a4e0f94-4766-8db1-c648-e72b1f7924fa@igel.co.jp> Date: Tue, 4 Apr 2023 19:11:55 +0900 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.15; rv:102.0) Gecko/20100101 Thunderbird/102.9.0 Subject: Re: [EXT] [RFC PATCH 06/11] misc: pci_endpoint_test: Use a common header file between endpoint driver Content-Language: en-US To: Frank Li , Gustavo Pimentel Cc: Vinod Koul , Lorenzo Pieralisi , =?UTF-8?Q?Krzysztof_Wilczy=c5=84ski?= , Manivannan Sadhasivam , Kishon Vijay Abraham I , Arnd Bergmann , Greg Kroah-Hartman , Bjorn Helgaas , Kunihiko Hayashi , Yoshihiro Shimoda , "linux-kernel@vger.kernel.org" , "dmaengine@vger.kernel.org" , "linux-pci@vger.kernel.org" References: <20230317113238.142970-1-mie@igel.co.jp> <20230317113238.142970-7-mie@igel.co.jp> From: Shunsuke Mie In-Reply-To: Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit X-Spam-Status: No, score=-1.9 required=5.0 tests=DKIM_SIGNED,DKIM_VALID, NICE_REPLY_A,RCVD_IN_DNSWL_NONE,SPF_HELO_NONE,SPF_PASS autolearn=unavailable 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/03/17 23:47, Frank Li wrote: >> pci@vger.kernel.org >> Subject: [EXT] [RFC PATCH 06/11] misc: pci_endpoint_test: Use a common >> header file between endpoint driver >> >> Caution: EXT Email >> >> Duplicated definitions between pci-epf-test and pci_endpoint_test are >> already moved to a header file. Remove the common definitions and include >> the header file. In addition, the separate register address writes were >> combined into a single write. >> >> Signed-off-by: Shunsuke Mie >> --- >> drivers/misc/pci_endpoint_test.c | 42 +------------------------------- >> 1 file changed, 1 insertion(+), 41 deletions(-) >> >> diff --git a/drivers/misc/pci_endpoint_test.c >> b/drivers/misc/pci_endpoint_test.c >> index 55733dee95ad..d4a42e9ab86a 100644 >> --- a/drivers/misc/pci_endpoint_test.c >> +++ b/drivers/misc/pci_endpoint_test.c >> @@ -22,52 +22,12 @@ >> #include >> >> #include >> +#include > Pci-epf-test.h was only used by these two files. > > Actually, I think move drivers/misc/pci_endpoint_test.c to under drivers/pci/endpoint/functions/ > And shared one private header is more reasonable. > These two files should be stay together because tight coupling. I agree that the shared header is not reasonable. However, it seems difficult to move pci_endpoint_test.c because it is not an endpoint function driver. Furthermore, since Kselftest adaption [1] is being worked on, I'd like to reconsider how we can apply the Kselftest patch. [1] https://lore.kernel.org/all/20221007053934.5188-1-aman1.gupta@samsung.com/ > >> #include >> >> #define DRV_MODULE_NAME "pci-endpoint-test" >> >> -#define IRQ_TYPE_UNDEFINED -1 >> -#define IRQ_TYPE_LEGACY 0 >> -#define IRQ_TYPE_MSI 1 >> -#define IRQ_TYPE_MSIX 2 >> - >> -#define PCI_ENDPOINT_TEST_MAGIC 0x0 >> - >> -#define PCI_ENDPOINT_TEST_COMMAND 0x4 >> -#define COMMAND_RAISE_LEGACY_IRQ BIT(0) >> -#define COMMAND_RAISE_MSI_IRQ BIT(1) >> -#define COMMAND_RAISE_MSIX_IRQ BIT(2) >> -#define COMMAND_READ BIT(3) >> -#define COMMAND_WRITE BIT(4) >> -#define COMMAND_COPY BIT(5) >> - >> -#define PCI_ENDPOINT_TEST_STATUS 0x8 >> -#define STATUS_READ_SUCCESS BIT(0) >> -#define STATUS_READ_FAIL BIT(1) >> -#define STATUS_WRITE_SUCCESS BIT(2) >> -#define STATUS_WRITE_FAIL BIT(3) >> -#define STATUS_COPY_SUCCESS BIT(4) >> -#define STATUS_COPY_FAIL BIT(5) >> -#define STATUS_IRQ_RAISED BIT(6) >> -#define STATUS_SRC_ADDR_INVALID BIT(7) >> -#define STATUS_DST_ADDR_INVALID BIT(8) >> - >> -#define PCI_ENDPOINT_TEST_LOWER_SRC_ADDR 0x0c >> -#define PCI_ENDPOINT_TEST_UPPER_SRC_ADDR 0x10 >> - >> -#define PCI_ENDPOINT_TEST_LOWER_DST_ADDR 0x14 >> -#define PCI_ENDPOINT_TEST_UPPER_DST_ADDR 0x18 >> - >> -#define PCI_ENDPOINT_TEST_SIZE 0x1c >> -#define PCI_ENDPOINT_TEST_CHECKSUM 0x20 >> - >> -#define PCI_ENDPOINT_TEST_IRQ_TYPE 0x24 >> -#define PCI_ENDPOINT_TEST_IRQ_NUMBER 0x28 >> - >> -#define PCI_ENDPOINT_TEST_FLAGS 0x2c >> -#define FLAG_USE_DMA BIT(0) >> - >> #define PCI_DEVICE_ID_TI_AM654 0xb00c >> #define PCI_DEVICE_ID_TI_J7200 0xb00f >> #define PCI_DEVICE_ID_TI_AM64 0xb010 >> -- >> 2.25.1 Best, Shunsuke.