Received: by 2002:a05:6358:45e:b0:b5:b6eb:e1f9 with SMTP id 30csp957389rwe; Wed, 24 Aug 2022 12:02:56 -0700 (PDT) X-Google-Smtp-Source: AA6agR7XXCIbRLm87M32XyU9/e7gUw69tR19UbEPUGIlY7bi+S30KO8AKx1ERu6esmaT2pPM1r70 X-Received: by 2002:a17:90b:1b42:b0:1fb:7a59:8965 with SMTP id nv2-20020a17090b1b4200b001fb7a598965mr552816pjb.140.1661367775964; Wed, 24 Aug 2022 12:02:55 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1661367775; cv=none; d=google.com; s=arc-20160816; b=RsuS63WnV4609DSfsptzi/EfJc2t8gCoErhKFtoZcFPJJ5D+kib0jEa0S9NlZZCZxx mJaemahpTk9tAuA6B05+tpE+uKEK/uaUkMghskGuRZrUS2EVrt2Xtnqs/2+zlFAGDMsw 0fXRBon6c4YOWy7pZ8UqoQdGhmyFA6dRPYfr79Df4pIDoiKhVDNGXjcEa47599hslR0a UEof/8MXftLixR6fjYttpTB8YhQxw46435K9b+S626FY6MdVT0x2dduWfr5BbZ9KqEg4 wR6pd9hwthifCJs1IhXpqjEiwvo+jacAvVNxMDilhWFZ2cSp5UOq7lUkEO6o5l9UCwVt WnNw== 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 :message-id:subject:cc:to:from:date:dkim-signature; bh=cpIOvVeZucBnKP3pHPs/kiK42PPk/bkhhq7WJRzrHgs=; b=iHi+3AA4OZnyv/YNgE2ERALWpYY1JZp7I8DxjskS/FConWwwqFVFsTGtcn7bU/1v0A PjbTAQkO//PKW3pY2GlApYoCiz7ISjGC/UHaGg/KCZcAsYhs+BbV1n0IJIyH6wVHRq17 j2MlInRMd+BJP9HnICXPft3GfdfW0rTS8zRKvsyMsE2+OeaatZu4rl8368YfztUgNS30 XmgHd0n94Kz307FQgY/Q8XQBJA+lNShRUii1Iog62sOzlHwSTVlcVzFl5HEL0p3cbEwE CYf0FzTVYYlelXTDiQYfMUWAlxkrL/xq7VRyyyVUEId05ieufvWHOvtLKm0y+i8gqYdd 6WeQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=AUVlNz6b; 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=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id t8-20020a17090a4e4800b001fb47ec7b5bsi1682849pjl.165.2022.08.24.12.02.42; Wed, 24 Aug 2022 12:02:55 -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=@kernel.org header.s=k20201202 header.b=AUVlNz6b; 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=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S240543AbiHXSSD (ORCPT + 99 others); Wed, 24 Aug 2022 14:18:03 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:54928 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S240491AbiHXSSA (ORCPT ); Wed, 24 Aug 2022 14:18:00 -0400 Received: from ams.source.kernel.org (ams.source.kernel.org [IPv6:2604:1380:4601:e00::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 35EF179602; Wed, 24 Aug 2022 11:17:58 -0700 (PDT) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ams.source.kernel.org (Postfix) with ESMTPS id EB148B8260B; Wed, 24 Aug 2022 18:17:56 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 71C62C433C1; Wed, 24 Aug 2022 18:17:55 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1661365075; bh=RNsalPlTzQYBjHmw/uAg0XtIxYyRx8+8Tf4jNcwZmbc=; h=Date:From:To:Cc:Subject:In-Reply-To:From; b=AUVlNz6bFTYbTExPwXIb22BpOPcIpxZ9oThZup19z5RH2Q/GLfbxGxx1JUGVuC57n kZjin4mY2yZPgod6VdGpVQ5nRnCFYM7v5PZo1UkCA6o6N3PXZb/449RMaRZKayjWET TbhLPsaoAg023EohoRkf79OEkE75Yca/lH+ttWC2NbTqFfQdKqb3WyRznpPvLDT4fl cK/uvhpmRn2dyaVqYQ8bBclyNmIsOkVF3hAxypBXKNM6SMQkONQIcx/59ZPAJnQO9I zBAmy0dJV07eLbGub1aTZAY77UxD+7aL56P7f8VxGgoc3zW8UdLGrBO2asAmvhhH+v ypXaYz+W0l+sw== Date: Wed, 24 Aug 2022 13:17:54 -0500 From: Bjorn Helgaas To: Serge Semin Cc: Serge Semin , Gustavo Pimentel , Vinod Koul , Rob Herring , Bjorn Helgaas , Lorenzo Pieralisi , Jingoo Han , Frank Li , Manivannan Sadhasivam , Lorenzo Pieralisi , Krzysztof =?utf-8?Q?Wilczy=C5=84ski?= , Alexey Malahov , Pavel Parkhomenko , linux-pci@vger.kernel.org, dmaengine@vger.kernel.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH RESEND v5 24/24] PCI: dwc: Add DW eDMA engine support Message-ID: <20220824181754.GA2794837@bhelgaas> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20220824181319.wkj4256a5jp2xjlp@mobilestation> X-Spam-Status: No, score=-7.1 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_HI, SPF_HELO_NONE,SPF_PASS,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 Wed, Aug 24, 2022 at 09:13:19PM +0300, Serge Semin wrote: > On Wed, Aug 24, 2022 at 11:51:18AM -0500, Bjorn Helgaas wrote: > > On Mon, Aug 22, 2022 at 09:53:32PM +0300, Serge Semin wrote: > > > + val = dw_pcie_readl_dbi(pci, PCIE_DMA_VIEWPORT_BASE + PCIE_DMA_CTRL); > > > + if (val == 0xFFFFFFFF && pci->edma.reg_base) { > > > + pci->edma.mf = EDMA_MF_EDMA_UNROLL; > > > + > > > + val = dw_pcie_readl_dma(pci, PCIE_DMA_CTRL); > > > + } else if (val != 0xFFFFFFFF) { > > > > > Consider PCI_POSSIBLE_ERROR() as an annotation about the meaning of > > 0xFFFFFFFF and something to grep for. > > In this case FFs don't mean an error but a special value, which > indicates that the eDMA is mapped via the unrolled CSRs space. The > similar approach has been implemented for the iATU legacy/unroll setup > auto-detection. So I don't see much reasons to have it grepped, so as > to have a macro-based parametrization since the special value will > unluckily change while having the explicit literal utilized gives a > better understanding of the way the algorithm works. If 0xFFFFFFFF is the result of a successful PCIe Memory Read, and not something synthesized by the host bridge when it handles an Unsupported Request completion, I'm fine with keeping it as is.