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 vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 41A8BC4332F for ; Thu, 15 Dec 2022 07:15:01 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229695AbiLOHO7 (ORCPT ); Thu, 15 Dec 2022 02:14:59 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:36450 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229945AbiLOHOa (ORCPT ); Thu, 15 Dec 2022 02:14:30 -0500 Received: from bombadil.infradead.org (bombadil.infradead.org [IPv6:2607:7c80:54:3::133]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 7C47BFDE; Wed, 14 Dec 2022 23:14:06 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=bombadil.20210309; h=In-Reply-To:Content-Type:MIME-Version :References:Message-ID:Subject:Cc:To:From:Date:Sender:Reply-To: Content-Transfer-Encoding:Content-ID:Content-Description; bh=U8tiGOfY6tAEqkhf0Y4a1OMzKNKXbK0qcbstpXtXJU8=; b=IRd0ZBfgjRkEwZY14DhynFGEJb /oQ48+Kfonp6Aj7wCCYVfibQFitoCpd//3njKcUK0cu1syKJnknoJ4KlEFOZoBDCZPdbm9TgPMD0I g5BhgFpVVo0GFYKBOZwudfPaiMJJz+iRBKRnf/FROAmtVfh8hVH8LKSs/yDzIBcK6pkOSYoW9oaz5 jXhyv7RPdQZv45FPRBfunJstNQoohURGKEXmNCMIeiOx7mfUGORb9dvzy7LmQUKzo1C++jOzxIfNm K4ZlxIno5EHzLPIqR78fZ6Be1KLhLWtvTB6dRe+Gg54+2V4nIjA/QZLotQDxNXljtFuSPMc0VQ3Ji M9DXIShQ==; Received: from hch by bombadil.infradead.org with local (Exim 4.94.2 #2 (Red Hat Linux)) id 1p5iR3-0077h5-9t; Thu, 15 Dec 2022 07:13:41 +0000 Date: Wed, 14 Dec 2022 23:13:41 -0800 From: Christoph Hellwig To: Serge Semin Cc: Gustavo Pimentel , Vinod Koul , Rob Herring , Bjorn Helgaas , Lorenzo Pieralisi , Cai Huoqing , Robin Murphy , Jingoo Han , Frank Li , Manivannan Sadhasivam , Lorenzo Pieralisi , Krzysztof =?utf-8?Q?Wilczy=C5=84ski?= , Serge Semin , Alexey Malahov , Pavel Parkhomenko , caihuoqing , Yoshihiro Shimoda , linux-pci@vger.kernel.org, dmaengine@vger.kernel.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH v7 23/25] PCI: dwc: Restore DMA-mask after MSI-data allocation Message-ID: References: <20221214235305.31744-1-Sergey.Semin@baikalelectronics.ru> <20221214235305.31744-24-Sergey.Semin@baikalelectronics.ru> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20221214235305.31744-24-Sergey.Semin@baikalelectronics.ru> X-SRS-Rewrite: SMTP reverse-path rewritten from by bombadil.infradead.org. See http://www.infradead.org/rpr.html Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Thu, Dec 15, 2022 at 02:53:03AM +0300, Serge Semin wrote: > DW PCIe Root Ports and End-points can be equipped with the DW eDMA engine. > In that case it is critical to have the platform device pre-initialized > with a valid DMA-mask so the drivers using the eDMA-engine would be able > to allocate the DMA-able buffers. The MSI-capable data requires to be > allocated from the lowest 4GB region. Since that procedure implies the > DMA-mask change we need to restore the mask set by the low-level drivers > after the MSI-data allocation is done. You can't change the DMA mask when there are existing allocations.