From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751995AbcFCHkL (ORCPT ); Fri, 3 Jun 2016 03:40:11 -0400 Received: from mout.kundenserver.de ([212.227.126.134]:51431 "EHLO mout.kundenserver.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751348AbcFCHkI (ORCPT ); Fri, 3 Jun 2016 03:40:08 -0400 From: Arnd Bergmann To: Bjorn Helgaas Cc: Bjorn Helgaas , Heiko Stuebner , Wenrui Li , Doug Anderson , linux-pci@vger.kernel.org, linux-rockchip@lists.infradead.org, linux-kernel@vger.kernel.org, Shawn Lin , Thomas Petazzoni , linux-arm-kernel@lists.infradead.org, Jingoo Han , Pratyush Anand , Hannes Reinecke , Alex Williamson Subject: Re: [PATCH 1/3] pci: introduce read_bridge/write_bridge pci ops Date: Thu, 02 Jun 2016 17:06:55 +0200 Message-ID: <3585926.N1C2xx3GaB@wuerfel> User-Agent: KMail/5.1.3 (Linux/4.4.0-22-generic; KDE/5.18.0; x86_64; ; ) In-Reply-To: <20160602140001.GB8262@localhost> References: <1464784332-3775650-1-git-send-email-arnd@arndb.de> <4967020.J4dsRYGugq@wuerfel> <20160602140001.GB8262@localhost> MIME-Version: 1.0 Content-Transfer-Encoding: 7Bit Content-Type: text/plain; charset="us-ascii" X-Provags-ID: V03:K0:KrJaCWvYbog5msjf1wY9M6pishvgBk5BVlkQkBU3wm6mOmjQhDi QVhfmrwWGngLbtd3V4CUZgHXGJr+UyFW/ttEy29AeKJP7E+AMpQOhFYOmfspaiMmg+3ryBw lzFwccO2jVP+fO0xM5+jlZTb0BI4dtUsz+h7kLFyQGzcFZLfipdgIhVNIj0yLcrAoZzMuY7 K6mjfLt0VVRgX2fe9OnYg== X-UI-Out-Filterresults: notjunk:1;V01:K0:OyTCDXmTT8g=:Bj2aSDCwLYAjT6DcN5bRgJ qaHX2Om27MQqEmoaHDIdGbncsCq+Sz6x2LoqfMU8z8uH2rATIYuJFjo5dw7/HvVvSk6crFJZc s2PJrJML2RvBCW7SimF9nbjmvLwYTLkQ0BhiRpsEYp2aEvsqeW6WRnHMxJiRqVQgAgY/CDs5K 58DasZvDbRZklwqBYgIiyQ2YLpaNLyOBJS4PhTNORT8uKR9z/+VzDUHPYJ2BzPi4yA0y2smSW HlmGcLT8mjJ3CmFZUh5RrmfwHwaBTe4hYZ9fLG0RYmQBA3JNI1Tqn3/rPAdkYyTu3d4Up3PvU 1gaJovAofYj8FLCauLs4T4WLiB0SjJUSuv6hJlfb4NfzSwkFfQBiBJnFleq4OwyDKJJVzK/lR Cr0LMlatb2q8x8QDb+1I2e/P7cH4E/dYuoON0wGj0zdNRLBGnuSQhyDKY95oBKc8x1foUlmjc PMemWfJ/BnBZa96T77iwAZA2w4aZ0GQYZZ/MrO72gBAwZ9GlUyPeFtG/JMqxcsVQ3FGMqKU83 T+VvAUX0uiQ0IOvECDB21J7xHgNcrSHaWYtmH6BPIPS43ZqRUHx3blNATRA5CvtMyez/z1WSd v9IVFNANztjJV4Af+MGHKY2vn1E9VijIEas3jy0/pJN0ibvr6MDCF/qsFEqALCoDy8F/OHVho OARNC8OIm0aLdNcle7IEcPzgCoy0auNcobsZP5nBS2jI/BzjdsG9LC3WLzZ1i0zK6u4WDhFlB hYOWzzgl6/D+Uiyf Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Thursday, June 2, 2016 9:00:01 AM CEST Bjorn Helgaas wrote: > > I just did a count of the implementations of pci_ops: I found 107 > > instances of 'struct pci_ops', and 67 of them treat type0 and type1 > > access differently in some form. > > > > I'd estimate that about half of them, or roughly a third of the total > > instances would benefit from my change, if we were to do them again. > > Clearly there is no need to change the existing code here when it works, > > unless the benefit is very clear and the code is actively maintained. > > > > In some cases, the difference is only that the root bus has a limited > > set of devices that are allowed to be accessed, so there would > > likely be no benefit of this, compared to e.g. yet another callback > > that checks the validity. > > Some other instances have type0 registers at a different memory location > > from type1, some use different layout inside of that space, and some > > are completely different. > > The type0/type1 distinction still seems out of place to me at the call > site. Is there any other reason a caller would care about the > difference between type0 and type1? The callers really shouldn't care, but they also shouldn't call the pci_ops function pointer (and as we found earlier, there are only three such callers). The distinction between type0 and type1 in my mind is an implementation detail of the pci_{read,write}_config_{byte,word,dword} functions that call the low-level operations here. Arnd