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 X-Spam-Level: X-Spam-Status: No, score=-4.0 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI, SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED autolearn=no autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 83E52C433E2 for ; Sat, 5 Sep 2020 20:46:06 +0000 (UTC) Received: from merlin.infradead.org (merlin.infradead.org [205.233.59.134]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id EBD8D20738 for ; Sat, 5 Sep 2020 20:46:05 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=lists.infradead.org header.i=@lists.infradead.org header.b="UEahc7uA" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org EBD8D20738 Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=linux.com Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=merlin.20170209; h=Sender:Content-Transfer-Encoding: Content-Type:Cc:List-Subscribe:List-Help:List-Post:List-Archive: List-Unsubscribe:List-Id:In-Reply-To:MIME-Version:References:Message-ID: Subject:To:From:Date:Reply-To:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Owner; bh=kmDqenuiK1h6p6j4Kuj8uN/EibpwgtD0s/StGe4PcHI=; b=UEahc7uAppJG1fFm1UB4TUCIK rtC4sdiV/eY8V7itnE5hovNpb7Yp0J1OlgH7geSvradvJmp3s82fm1xF4swXRdyLLt5nywB5olOWV xp7dLDX9NG3H7J85MydIWlC0Z7umvE+LEbjW9jcvUxT631S8Sa259exR7J2bWTzBC0c+uSSnqo36J C/jocBcynw2a0wrDYNzwmUlFpPuvefGdc0ScZc9GXdU8ykdOwL0r8zhku7lnRKYFVAqic7cBLd6r6 TAdhdY/MIz9FKbswM6O4V2S7lqSn1CPT2nG1Nbtj6qRnmULVU9EH90BW+QvjhuKdSgn9JpLdfoqgm J0XudEfhg==; Received: from localhost ([::1] helo=merlin.infradead.org) by merlin.infradead.org with esmtp (Exim 4.92.3 #3 (Red Hat Linux)) id 1kEf2v-000259-M1; Sat, 05 Sep 2020 20:44:25 +0000 Received: from mail-lj1-f196.google.com ([209.85.208.196]) by merlin.infradead.org with esmtps (Exim 4.92.3 #3 (Red Hat Linux)) id 1kEf2s-00024P-AS; Sat, 05 Sep 2020 20:44:23 +0000 Received: by mail-lj1-f196.google.com with SMTP id a15so11867750ljk.2; Sat, 05 Sep 2020 13:44:20 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to; bh=671tuV+5QYoJp/HkFJ0gD7Y6tBP+J04Z5kQy3jbSXss=; b=USIgAJyBEGDC4d5/DkxihZGyvSEOtpd0uT9MDkaMqMaJlMhfKFHr2XIDc6hJ2FVGx/ 8IWzSPtINuL7YHfUc3WXSp8QCrVKyUS3mgZRWp/Vup7widMR5eIgAlYfoPZfZIBIKCTI hx84iwfXOX714CBvTjsafNahZOVCXrs8W72bBqXQ6u2W/JeZ7k1n0Nfpc5yjITBZJR3u LsE0JbybsVifANWGHdwEVM8WrWryZyVhf3T6aQvT0XLN/iK+YzCaJSN2s1RveziKR63K qCQXzhIricY6kQnwrf5ai25jUaDXZqsm/3XGXp808X4u3lUJVEzvixpJHG/ZbSpbGtga rk3A== X-Gm-Message-State: AOAM531oYPuPEBA5VxULVbQaMQ/fau2UZTCO6J3P6APPhDYlnpqRxbMp XDycDn51TvyBVwymeGEb7NA= X-Google-Smtp-Source: ABdhPJyXeuw1d2QUIlbDtbaneQ5+q+irrrq0cJRGJd9l8xSoUw78Y1nTihKLCprWlSBu4qdcF15ScA== X-Received: by 2002:a2e:889a:: with SMTP id k26mr6578454lji.214.1599338658314; Sat, 05 Sep 2020 13:44:18 -0700 (PDT) Received: from rocinante ([95.155.85.46]) by smtp.gmail.com with ESMTPSA id x11sm2709379ljh.106.2020.09.05.13.44.16 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 05 Sep 2020 13:44:17 -0700 (PDT) Date: Sat, 5 Sep 2020 22:44:16 +0200 From: Krzysztof =?utf-8?Q?Wilczy=C5=84ski?= To: Jonathan Cameron Subject: Re: [PATCH] PCI: Unify ECAM constants in native PCI Express drivers Message-ID: <20200905204416.GA83847@rocinante> References: <20200827224938.977757-1-kw@linux.com> <20200828100843.0000474e@Huawei.com> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: <20200828100843.0000474e@Huawei.com> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20200905_164422_384911_2C171B20 X-CRM114-Status: GOOD ( 10.91 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Lorenzo Pieralisi , Heiko Stuebner , linux-pci@vger.kernel.org, Shawn Lin , Michal Simek , linux-rockchip@lists.infradead.org, Zhou Wang , Robert Richter , Jonathan Chocron , Bjorn Helgaas , Will Deacon , linux-arm-kernel@lists.infradead.org Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org Hello Jonathan, Thank you for the review! Also, apologies for late reply. On 20-08-28 10:08:43, Jonathan Cameron wrote: [...] > > Might potentially be worth tidying up the masks as well? > Or potentially drop them given I suspect that there are no cases > in which the mask is actually doing anything... Just to confirm - you have the following constants in mind? drivers/pci/controller/pcie-rockchip.h: #define PCIE_ECAM_BUS(x) (((x) & 0xff) << 20) #define PCIE_ECAM_DEV(x) (((x) & 0x1f) << 15) #define PCIE_ECAM_FUNC(x) (((x) & 0x7) << 12) drivers/pci/controller/dwc/pcie-al.c: #define PCIE_ECAM_DEVFN(x) (((x) & 0xff) << 12) I can move PCIE_ECAM_BUS, PCIE_ECAM_DEV and PCIE_ECAM_FUNC (as PCIE_ECAM_FUN) to the linux/pci-ecam.h file, as these seem useful, but without the masks, and then update other files to use these. We could then leverage these, for example: pci_base_addr = (void __iomem *)((uintptr_t)pp->va_cfg0_base + - (busnr_ecam << 20) + - PCIE_ECAM_DEVFN(devfn)); + PCIE_ECAM_BUS(busnr_ecam) + + PCIE_ECAM_FUN(devfn)); What do you think? Bjorn, would that be acceptable? Krzysztof _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel