Received: by 2002:a05:6358:d09b:b0:dc:cd0c:909e with SMTP id jc27csp667366rwb; Thu, 15 Dec 2022 00:22:29 -0800 (PST) X-Google-Smtp-Source: AA0mqf5wfjk3hXKJ9FYJUduFu76glNjEMI0lp2PfhDGI8iRdT0ZqKvsZRisbLjNEQYxyPhHUL0Ao X-Received: by 2002:a17:907:20a4:b0:7c1:6167:7816 with SMTP id pw4-20020a17090720a400b007c161677816mr17325349ejb.28.1671092549005; Thu, 15 Dec 2022 00:22:29 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1671092548; cv=none; d=google.com; s=arc-20160816; b=DVxlgSAQiOw+Q2yAumSR8M3N/ss7+5bx0vHEKTkH9xVYoiEJX/1GC3SdAWQgO2wAgt BWynJb7/Y+93QElxsL35SDilntTIh4eXrH8Z8i46pwFH68yh6+QH8LVhpes4Sej17I69 pTqWKcH8rlUF+08zvcbU7dl5I+M4pa0OsLP8T+ZopsiBCHLuSn/yRqIBjMcTyB9+PQcz FpKj06xh0hsOGkgkbOjm2A4EKV5Wo4shH/fqnWRd+by4NxlkvLMmgf2+RJdPqYs/nr7f JQNvmnezin8sD7YtXL9N+0LhwiYssRkJI1CF0oGwa5fseULq+kewHmqda+VDH4it81Qs C+3g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-disposition:mime-version :references:message-id:subject:cc:to:from:date:dkim-signature; bh=U8tiGOfY6tAEqkhf0Y4a1OMzKNKXbK0qcbstpXtXJU8=; b=OghuzeOmiM9F6fYGRQppm5oqrDJ6YJf3vgdt0iDIjLnpovMegMxIxI6CmZA9RSvCsK pon6CBhNfSmvtYZYj6ItS7n5ZRkXH9gDkYq3OMrZ6uRSRHzzA5jO51Lg4dMTVB6hzR9B qfHeyraZONcR1ib9LrpSy4MddvxW8N3vp92hUDyGspoe5Eo8dKYA0UggbeepNaNXZ4XK ZJmbl3HndtV9uwZbF0gVeyAINcYIHJ/XujSSzBBH3AwjSxZKK8AxJuetX1E+ocGziqMG KfTPZMOf9p+C7edRMRH4qUV73CCMkDvEpvzZO4bna6ZSJEcQ2HUsdt0wu1pB2V2ypIfA AV+Q== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@infradead.org header.s=bombadil.20210309 header.b=IRd0ZBfg; 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 xd12-20020a170907078c00b007a835c56b70si12477859ejb.267.2022.12.15.00.22.12; Thu, 15 Dec 2022 00:22:28 -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=@infradead.org header.s=bombadil.20210309 header.b=IRd0ZBfg; 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 S229480AbiLOHO5 (ORCPT + 69 others); Thu, 15 Dec 2022 02:14:57 -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 X-Spam-Status: No, score=-4.4 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_MED,SPF_HELO_NONE, SPF_NONE 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 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.