Received: by 2002:a05:6358:45e:b0:b5:b6eb:e1f9 with SMTP id 30csp238607rwe; Wed, 31 Aug 2022 01:46:34 -0700 (PDT) X-Google-Smtp-Source: AA6agR4LHdJgVqpYoSdCYB4SmMymfOyekmZyjPcSRBsVy4KJt8d6HUNV7dAjGzAOtC00YancYLuX X-Received: by 2002:a17:902:bf06:b0:172:cf73:df43 with SMTP id bi6-20020a170902bf0600b00172cf73df43mr25102812plb.13.1661935594573; Wed, 31 Aug 2022 01:46:34 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1661935594; cv=none; d=google.com; s=arc-20160816; b=JptNtZ6Etk9iOOugTxVEzbPzqgEkarya2D0OE8pqGCb3YxEoWQn4Sdi0QcYhtB72bB 8UnlKZmGK/Q3rjH2/5Ok2vIv4ph3LiUtpmYs+qYJf7NdkV/KotZeNGa9fcooBAgy9aLC yYK/MkIrSsdHuWG5Unyv0ugDtbdMUEx+qcQeeK9qqNibwvmooIkZ0b3iNsr+7a5PpnpT sYFS3bahygCwlZ0dF2VMJt0n5XLl+hsxX1abjTPMA3xQHjzrIcu0nz9eG+96bnPI0gI6 TsV0Co5zlaKSxLcrc99Ls0+XidlmxokvFg7FWsPWumuemr3HuIGChRrH+SdJwpLxJdl0 5VNQ== 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; bh=jyDDomDfBGijA1feGTz9Ws4mm6KeIS+WOWg9+CRyU6Y=; b=kql+A88E8UC+mrmH1RuAqhjZiDIv65vij59WIGZ0Kof0pQ36okzYLK9n9c92j6Ob4w tcEROvLEH8H4H5zONIanuGraoXzL+IPQtRKMzDtqwYVdbc3B0RDXgCP1MmuVmmIuG8BU fkZR8dzaazO9pVUL1g+bBBg6KcgNjibDNW8gWVyK34KaI4M0zrJKqtZ8boBy8R1kPQat XB2Zvgr7A5x2mgxCnFF9A/KDLOtlgFd/0qp9AKg8f1AnvDJ3zIX5mFCouUDkbQ77bci2 LQtm5RZpikYAMd3VfdvOxni9P6LKn/V0mv/i4Oj0cMfqBV5gkd2GZrpiuZPFAHaLzZ5M w/UQ== 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 a10-20020a1709027d8a00b0016dc46e62ebsi12851510plm.384.2022.08.31.01.46.23; Wed, 31 Aug 2022 01:46:34 -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 S231152AbiHaIg5 (ORCPT + 99 others); Wed, 31 Aug 2022 04:36:57 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:47258 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230480AbiHaIg4 (ORCPT ); Wed, 31 Aug 2022 04:36:56 -0400 Received: from foss.arm.com (foss.arm.com [217.140.110.172]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id 12E50A8CFC; Wed, 31 Aug 2022 01:36: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 E24E7ED1; Wed, 31 Aug 2022 01:37:00 -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 EE5C23F766; Wed, 31 Aug 2022 01:36:51 -0700 (PDT) Message-ID: <63a54a1b-66ba-9739-8217-13f75e602cd5@arm.com> Date: Wed, 31 Aug 2022 09:36:46 +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 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> From: Robin Murphy In-Reply-To: Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit 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-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. Thanks, Robin.