From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751797AbcIBCJD (ORCPT ); Thu, 1 Sep 2016 22:09:03 -0400 Received: from szxga02-in.huawei.com ([119.145.14.65]:35005 "EHLO szxga02-in.huawei.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751687AbcIBCJB (ORCPT ); Thu, 1 Sep 2016 22:09:01 -0400 Subject: Re: [RFC PATCH V2 1/3] PCI: hisi: re-architect Hip05/Hip06 controllers driver to preapare for ACPI To: Arnd Bergmann References: <1472644094-82731-1-git-send-email-liudongdong3@huawei.com> <5913196.I3zIbc2qla@wuerfel> <57C822C1.9000203@huawei.com> <6532722.cVEMfv9Kqj@wuerfel> CC: , , , , , , , , , , , , , From: Dongdong Liu Message-ID: <57C8DDBD.5070103@huawei.com> Date: Fri, 2 Sep 2016 10:02:37 +0800 User-Agent: Mozilla/5.0 (Windows NT 6.1; rv:38.0) Gecko/20100101 Thunderbird/38.5.0 MIME-Version: 1.0 In-Reply-To: <6532722.cVEMfv9Kqj@wuerfel> Content-Type: text/plain; charset="utf-8"; format=flowed Content-Transfer-Encoding: 8bit X-Originating-IP: [10.61.21.156] X-CFilter-Loop: Reflected X-Mirapoint-Virus-RAPID-Raw: score=unknown(0), refid=str=0001.0A020206.57C8DDCB.001C,ss=1,re=0.000,recu=0.000,reip=0.000,cl=1,cld=1,fgs=0, ip=0.0.0.0, so=2013-06-18 04:22:30, dmn=2013-03-21 17:37:32 X-Mirapoint-Loop-Id: 6b60579a62a3709f19494addd2c565a6 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hi Arnd 在 2016/9/1 22:02, Arnd Bergmann 写道: > >> 2. We need to backward compatible with the old dt way config access as below code, >> so we have to call hisi_pcie_common_cfg_read() when accessing the RC config space. >> For this, we have to call hisi_pcie_common_cfg_read(). >> >> drivers/pci/host/pcie-hisi.c >> static inline int hisi_pcie_cfg_read(struct pcie_port *pp, int where, >> int size, u32 *val) >> { >> struct hisi_pcie *pcie = to_hisi_pcie(pp); >> >> return hisi_pcie_common_cfg_read(pcie->reg_base, where, size, val); >> } >> >> static struct pcie_host_ops hisi_pcie_host_ops = { >> .rd_own_conf = hisi_pcie_cfg_read, >> .wr_own_conf = hisi_pcie_cfg_write, >> .link_up = hisi_pcie_link_up, >> }; > > I think this would be easier if you separate the ACPI code from the > DT code and not try to have a common file used for both. > > Sharing the config space accessors really isn't worth it when both > variants are fairly simple to do, but they don't fit in a common > model because one is called from the ACPI quirks and the other > is called from the dw-pcie driver with completely different calling > conventions. I agree, many thanks. Thanks Dongdong > > ARnd > -- > To unsubscribe from this list: send the line "unsubscribe linux-acpi" in > the body of a message to majordomo@vger.kernel.org > More majordomo info at http://vger.kernel.org/majordomo-info.html > > . >