Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1720532

Re: [PATCH V2] spmi: pmic-arb: Enforce the ownership check optionally

From Shawn Guo <shawnguo@kernel.org>
Newsgroups linux.kernel
Subject Re: [PATCH V2] spmi: pmic-arb: Enforce the ownership check optionally
Date 2017-08-26 05:50 +0200
Message-ID <uiAgF-4tz-1@gated-at.bofh.it> (permalink)
References (3 earlier) <uho7U-7sy-25@gated-at.bofh.it> <uhZh8-6r5-19@gated-at.bofh.it> <ui5cS-1GO-11@gated-at.bofh.it> <uihxn-1bl-15@gated-at.bofh.it> <uiw3n-1Uf-3@gated-at.bofh.it>
Organization linux.* mail to news gateway

Show all headers | View raw


On Fri, Aug 25, 2017 at 04:18:18PM -0700, Stephen Boyd wrote:
> On 08/25, Shawn Guo wrote:
> > On Thu, Aug 24, 2017 at 11:37:01AM -0700, Stephen Boyd wrote:
> > > On 08/24, Shawn Guo wrote:
> > > > On Tue, Aug 22, 2017 at 01:31:32PM -0700, Stephen Boyd wrote:
> > > > > Also, I see that on v4.13-rc series the read/write checks are
> > > > > causing the led driver to fail in a different way:
> > > > > 
> > > > >     spmi spmi-0: error: impermissible write to peripheral sid:0 addr:0xc040
> > > > >     qcom-spmi-gpio 200f000.spmi:pm8916@0:gpios@c000: write 0x40 failed
> > > > >     leds-gpio soc:leds: Error applying setting, reverse things back
> > > > >     spmi spmi-0: error: impermissible write to peripheral sid:0 addr:0xc041
> > > > >     qcom-spmi-gpio 200f000.spmi:pm8916@0:gpios@c000: write 0x41 failed
> > > > >     leds-gpio: probe of soc:leds failed with error -1 
> > > > > 
> > > > > Are you seeing similar behavior?
> > > > 
> > > > Yes.  I forgot to mention that, and leds-gpio failure is gone after
> > > > applying Kiran's patch below.
> > > > 
> > > > spmi: pmic-arb: remove the read/write access checks
> > > > 
> > > 
> > > Sure. Removing the checks will silence the warnings, but it still
> > > means that we're attempting to configure GPIOs that we shouldn't
> > > be configuring.
> > 
> > The driver is attempting to configure the GPIOs that device tree tells
> > to.
> > 
> > 	led@3 {                        
> > 		label = "apq8016-sbc:green:user3";
> > 		gpios = <&pm8916_gpios 1 GPIO_ACTIVE_HIGH>;
> > 		linux,default-trigger = "mmc1";
> > 		default-state = "off";         
> > 	};
> > 
> > Are you saying, in case of user3 led above, device tree shouldn't use
> > GPIO <&pm8916_gpios 1> there at all?
> 
> Right. Does the GPIO work? If so, it sounds like the read/write
> access checks in spmi pmic arb don't work properly.

The check works.  With the check in there, PM8916 GPIO doesn't work.
However, the consequence is that not only user3 but all GPIO leds under
'leds' node will fail to register, because any GPIO led's failing on
create_gpio_led() makes leds-gpio driver probe fail as a while.  That's
how leds-gpio driver works.

Also, per schematics, PM8916 GPIO1 is indeed routed to user3 LED on
db410c board.  Why do you think apq8016-sbc device tree shouldn't use
the GPIO for that at all?  Isn't it firmware's fault that the ownership
of the peripheral is not properly configured?

Shawn

Back to linux.kernel | Previous | NextPrevious in thread | Next in thread | Find similar | Unroll thread


Thread

Re: [PATCH V2] spmi: pmic-arb: Enforce the ownership check optionally Stephen Boyd <sboyd@codeaurora.org> - 2017-08-26 01:20 +0200
  Re: [PATCH V2] spmi: pmic-arb: Enforce the ownership check optionally Shawn Guo <shawnguo@kernel.org> - 2017-08-26 05:50 +0200
    Re: [PATCH V2] spmi: pmic-arb: Enforce the ownership check optionally Stephen Boyd <sboyd@codeaurora.org> - 2017-08-30 23:10 +0200
      Re: [PATCH V2] spmi: pmic-arb: Enforce the ownership check optionally Shawn Guo <shawnguo@kernel.org> - 2017-08-31 10:40 +0200
        Re: [PATCH V2] spmi: pmic-arb: Enforce the ownership check optionally Stephen Boyd <sboyd@codeaurora.org> - 2017-09-01 03:40 +0200
          Re: [PATCH V2] spmi: pmic-arb: Enforce the ownership check optionally Shawn Guo <shawnguo@kernel.org> - 2017-09-01 05:10 +0200

csiph-web