Received: by 2002:a05:6358:45e:b0:b5:b6eb:e1f9 with SMTP id 30csp266069rwe; Wed, 31 Aug 2022 02:22:44 -0700 (PDT) X-Google-Smtp-Source: AA6agR5t9zyITcFbjYLbKexIH61HelwjKPWay4s7/zup9V6dHQ7xod1wM4A6PGkXz9CL6dHR14lw X-Received: by 2002:a17:90b:4f91:b0:1cd:3a73:3a5d with SMTP id qe17-20020a17090b4f9100b001cd3a733a5dmr2337870pjb.98.1661937764055; Wed, 31 Aug 2022 02:22:44 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1661937764; cv=none; d=google.com; s=arc-20160816; b=rCNPnlpVk0TEpEv7xWPy1VExoFBcmH1ElZt1U1u10ec55CQcbW2A52tXeIoWdDO9ke L65h5Y0lNpj4rDn7MMQdVPCzOzb6C/7AINmfUKLDEHMydW78MtHvB/10Jc9sXBtW/6G/ wl/tgy1XBa0ExeMNuaaUuUdLekCIuWLPLh9eB1NOxLd4QYblRyzgjhczD1H+IoPHvx3C mXjzfG1ci1siGLPsxrKDGBIJuJxt8rGB22VoLLJ2UmxlYE4Yz+l4u90PlAmwB0niZ6qW f+nM+hrNH4lzRPc1AnGAiO4ai1XFtVEMFX3iLeFw/jxEcwPPI+AcX07ASn0FybRDJkbV hwjA== 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:references :cc:to:from:content-language:subject:user-agent:mime-version:date :message-id; bh=tKFUsdn1ABQNLq/f2jGcMlwR1mBmNDbhLqMTGeWlsuc=; b=ZwlBH1MNtlRvcceTIUJD2p9fcLerWtU19ExoiLY2YKZfgZSuQUAGe1rsZULYrEd2S9 lHNYcdamv2bj/q4jfo9bDiBEdhSGOy75Ph4QYUwKlcCZAMWZcQVhJFveJ+EyUIRKEKk2 RU0Ou6j+kS5zdDMTebQRDQSSfY2IbeVdw257+VGvDG+8P5bRESOjxIbBYp2WoXdPm3jQ YzFs+5z2UFT4TyD5TEXkAJoMsTUa4MlAIJRx7EhSgqripx0v8p4T6IzYb1zEgWMxvU5Z G8H/zHqnjq582+rZNfOjUIGclImoxPSysT71P0KKkKQPXicU2rHf7ay+hqoPKKczb6Y+ a6Qg== ARC-Authentication-Results: i=1; mx.google.com; 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=fail (p=NONE sp=NONE dis=NONE) header.from=arm.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id jm16-20020a17090304d000b001744cf05e58si11763514plb.305.2022.08.31.02.22.25; Wed, 31 Aug 2022 02:22:44 -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; 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=fail (p=NONE sp=NONE dis=NONE) header.from=arm.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231786AbiHaIz7 (ORCPT + 99 others); Wed, 31 Aug 2022 04:55:59 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:45984 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231695AbiHaIzi (ORCPT ); Wed, 31 Aug 2022 04:55:38 -0400 Received: from foss.arm.com (foss.arm.com [217.140.110.172]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id 86A921F2C5; Wed, 31 Aug 2022 01:54:55 -0700 (PDT) Received: from usa-sjc-imap-foss1.foss.arm.com (unknown [10.121.207.14]) by usa-sjc-mx-foss1.foss.arm.com (Postfix) with ESMTP id 013B1ED1; Wed, 31 Aug 2022 01:54:30 -0700 (PDT) Received: from [10.57.15.237] (unknown [10.57.15.237]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPSA id 0A32D3F71A; Wed, 31 Aug 2022 01:54:20 -0700 (PDT) Message-ID: <98179709-1ece-61ab-d43a-fc38a4fd3f67@arm.com> Date: Wed, 31 Aug 2022 09:54:14 +0100 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (Windows NT 10.0; rv:102.0) Gecko/20100101 Thunderbird/102.2.0 Subject: Re: [PATCH v5 20/20] PCI: dwc: Add Baikal-T1 PCIe controller support Content-Language: en-GB From: Robin Murphy To: Lorenzo Pieralisi , Serge Semin Cc: Rob Herring , Rob Herring , Krzysztof Kozlowski , Bjorn Helgaas , Lorenzo Pieralisi , Jingoo Han , Gustavo Pimentel , =?UTF-8?Q?Krzysztof_Wilczy=c5=84ski?= , Serge Semin , Alexey Malahov , Pavel Parkhomenko , Frank Li , Manivannan Sadhasivam , linux-pci@vger.kernel.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, willmcvicker@google.com References: <20220822184701.25246-1-Sergey.Semin@baikalelectronics.ru> <20220822184701.25246-21-Sergey.Semin@baikalelectronics.ru> <63a54a1b-66ba-9739-8217-13f75e602cd5@arm.com> In-Reply-To: <63a54a1b-66ba-9739-8217-13f75e602cd5@arm.com> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-6.9 required=5.0 tests=BAYES_00,NICE_REPLY_A, RCVD_IN_DNSWL_HI,SPF_HELO_NONE,SPF_NONE,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 On 2022-08-31 09:36, Robin Murphy wrote: > On 2022-08-29 16:28, Lorenzo Pieralisi wrote: > [...] >>> +static int bt1_pcie_add_port(struct bt1_pcie *btpci) >>> +{ >>> +    struct device *dev = &btpci->pdev->dev; >>> +    int ret; >>> + >>> +    /* >>> +     * DW PCIe Root Port controller is equipped with eDMA capable of >>> +     * working with the 64-bit memory addresses. >>> +     */ >>> +    ret = dma_set_mask_and_coherent(dev, DMA_BIT_MASK(64)); >>> +    if (ret) >>> +        return ret; >> >> Is this the right place to set the DMA mask for the host controller >> embedded DMA controller (actually, the dev pointer is the _host_ >> controller device) ? >> >> How this is going to play when combined with: >> >> https://lore.kernel.org/linux-pci/1e63a581-14ae-b4b5-a5bf-ca8f09c33af6@arm.com >> >> It is getting a bit confusing. I believe the code in the link >> above sets the mask so that through the DMA API we are capable >> of getting an MSI doorbell virtual address whose physical address >> can be addressed by the endpoint; this through the DMA API. >> >> This patch is setting the DMA mask for a different reason, namely >> setting the host controller embedded DMA controller addressing >> capabilities. >> >> AFAICS - both approaches set the mask for the same device - now >> the question is about which one is legitimate and how to handle >> the other. > > Assuming the dw-edma-pcie driver is the relevant one, that already sets > its own masks on its own device, so I also don't see why this is here. Ah, I just found the patch at [1], which further implies that this is indeed completely bogus. Robin. [1] https://lore.kernel.org/dmaengine/20220822185332.26149-23-Sergey.Semin@baikalelectronics.ru/