Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752614AbdHQKIf (ORCPT ); Thu, 17 Aug 2017 06:08:35 -0400 Received: from smtp.codeaurora.org ([198.145.29.96]:39950 "EHLO smtp.codeaurora.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752557AbdHQKIb (ORCPT ); Thu, 17 Aug 2017 06:08:31 -0400 MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII; format=flowed Content-Transfer-Encoding: 7bit Date: Thu, 17 Aug 2017 15:38:30 +0530 From: kgunda@codeaurora.org To: Shawn Guo Cc: gregkh@linuxfoundation.org, sboyd@codeaurora.org, Abhijeet Dharmapurikar , David Collins , linux-kernel@vger.kernel.org, linux-arm-msm@vger.kernel.org, linux-arm-msm-owner@vger.kernel.org Subject: Re: [PATCH V2 11/12] spmi: pmic-arb: add support for HW version 5 In-Reply-To: <20170817074150.GA17549@dragon> References: <1501225847-27807-1-git-send-email-kgunda@codeaurora.org> <1501225847-27807-12-git-send-email-kgunda@codeaurora.org> <20170817074150.GA17549@dragon> Message-ID: <3d9ed27c23523965dae6706ff007f1b1@codeaurora.org> User-Agent: Roundcube Webmail/1.2.5 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 2866 Lines: 81 On 2017-08-17 13:11, Shawn Guo wrote: > Hi Kiran, > > On Fri, Jul 28, 2017 at 12:40:46PM +0530, Kiran Gunda wrote: >> From: David Collins >> >> Add support for version 5 of the SPMI PMIC arbiter. It utilizes >> different offsets for registers than those found on version 3. >> Also, the procedure to determine if writing and IRQ access is >> allowed for a given PPID changes for version 5. >> >> Signed-off-by: David Collins >> Signed-off-by: Kiran Gunda >> Reviewed-by: Stephen Boyd >> --- >> drivers/spmi/spmi-pmic-arb.c | 236 >> +++++++++++++++++++++++++++++++++++++++---- >> 1 file changed, 214 insertions(+), 22 deletions(-) >> >> diff --git a/drivers/spmi/spmi-pmic-arb.c >> b/drivers/spmi/spmi-pmic-arb.c >> index bc68e08..3f46445 100644 >> --- a/drivers/spmi/spmi-pmic-arb.c >> +++ b/drivers/spmi/spmi-pmic-arb.c > > > >> @@ -680,12 +701,19 @@ static int >> qpnpint_irq_domain_dt_translate(struct irq_domain *d, >> ppid = intspec[0] << 8 | intspec[1]; >> rc = pmic_arb->ver_ops->ppid_to_apid(pmic_arb, ppid); >> if (rc < 0) { >> - dev_err(&pmic_arb->spmic->dev, "failed to xlate sid = 0x%x, periph >> = 0x%x, irq = %x rc = %d\n", >> + dev_err(&pmic_arb->spmic->dev, "failed to xlate sid = %#x, periph = >> %#x, irq = %u rc = %d\n", >> intspec[0], intspec[1], intspec[2], rc); >> return rc; >> } >> >> apid = rc; >> + if (pmic_arb->apid_data[apid].irq_ee != pmic_arb->ee) { >> + dev_err(&pmic_arb->spmic->dev, "failed to xlate sid = %#x, periph = >> %#x, irq = %u: ee=%u but owner=%u\n", >> + intspec[0], intspec[1], intspec[2], pmic_arb->ee, >> + pmic_arb->apid_data[apid].irq_ee); >> + return -ENODEV; >> + } >> + > > It seems to me that this check breaks pm8916_gpios on db410c. It > causes > the failure of pinctrl-spmi-gpio driver probing, because npins returned > from platform_irq_count() call is 0. > > Shawn > Hi Shawn, The intention of this check is to avoid the access to the peripherals those are not owned by the current EE (APSS) and it is expected to return a failure if the peripheral that is not owned by the current EE is trying to be accessed. Looks like you trying to access the GPIOs 0xc000 and 0xc100, which are owned by modem subsystem but not the APSS. That is why you seeing the failure for that. Please change the ownership of those GPIOs to APSS (id '0') if you are working on a non-modem device (APQ). Thanks, Kiran >> /* Keep track of {max,min}_apid for bounding search during interrupt >> */ >> if (apid > pmic_arb->max_apid) >> pmic_arb->max_apid = apid; > -- > To unsubscribe from this list: send the line "unsubscribe > linux-arm-msm" in > the body of a message to majordomo@vger.kernel.org > More majordomo info at http://vger.kernel.org/majordomo-info.html