Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from lists.ozlabs.org (lists.ozlabs.org [112.213.38.117]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 647D6C433EF for ; Wed, 11 May 2022 08:02:57 +0000 (UTC) Received: from boromir.ozlabs.org (localhost [IPv6:::1]) by lists.ozlabs.org (Postfix) with ESMTP id 4KynTC68v3z3bYF for ; Wed, 11 May 2022 18:02:55 +1000 (AEST) Authentication-Results: lists.ozlabs.org; dkim=pass (2048-bit key; unprotected) header.d=yahoo.com header.i=@yahoo.com header.a=rsa-sha256 header.s=s2048 header.b=l4Uh8Cy0; dkim-atps=neutral Authentication-Results: lists.ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=yahoo.com (client-ip=77.238.178.200; helo=sonic303-19.consmr.mail.ir2.yahoo.com; envelope-from=niikita@yahoo.com; receiver=) Authentication-Results: lists.ozlabs.org; dkim=pass (2048-bit key; unprotected) header.d=yahoo.com header.i=@yahoo.com header.a=rsa-sha256 header.s=s2048 header.b=l4Uh8Cy0; dkim-atps=neutral Received: from sonic303-19.consmr.mail.ir2.yahoo.com (sonic303-19.consmr.mail.ir2.yahoo.com [77.238.178.200]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange ECDHE (P-256) server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by lists.ozlabs.org (Postfix) with ESMTPS id 4KynST40Cnz2xnT for ; Wed, 11 May 2022 18:02:14 +1000 (AEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=yahoo.com; s=s2048; t=1652256129; bh=cIuj9SaINZOJjzSgGDWtStkP8njzjfrOsV+TNGiY9xA=; h=Date:From:To:In-Reply-To:References:Subject:From:Subject:Reply-To; b=l4Uh8Cy0rbcxZcrMqAmzf5JiFhMG2ZafpGvwNtNY/p2b2BFOw5rZLSmIUFyYClPQTNq5JTZEHvg7xhWQr7XyZyavaua7dflXEIBhF/feuBlZ03F2TeFHexvOH1Va/6/H124m38NXsfCT2xZ8bTd8D5yNtSgh/YeasznsbfUc5uVVecLemMVi2Kvn1IZQu5fhVai95Blq0ghbViZtRoikNFymCSqUD1hXwTvfPS7wdffXDUsbUsTOrLJrouk2Jcz7lb+OLOTvGZjvFZW+3Q5u4vZj8lxx9iKFABukyKihUtP6+6U9vKJTVaFb61+xMdkdTCyiivjCMpNew5cuFY90wg== X-SONIC-DKIM-SIGN: v=1; a=rsa-sha256; c=relaxed/relaxed; d=yahoo.com; s=s2048; t=1652256129; bh=xTgA5zjqdtqvxzESr6FW9hMa3kCcOJwsBDDoxsp1oVM=; h=X-Sonic-MF:Date:From:To:Subject:From:Subject; b=M2PRG7BHQR/GZW1FEklbFeRXEaiOeDXpJLsIsb22UF7VdzxCFOd9FAITKJWRDDLYkEHy75FL1RTRiX+wxiPSAXbWajFN8Sf9CxtvQyXcZewAdnB+Scp4qAvZq33eOyC26zVs7gN/EIKWLa7sCJnz1eMlU1QBAM31/5sDbut+apFpshHOByKmrETXxfe9Vu1wpmNPi0Ydw0N0nFku/NMrWq6XwnvaEXR/0Lzfze4d3HeZRGC2PCD3Xt61WmO4F5SunBAXggP0j8Uv0+QO6qvaNIk0/mA+ylEPgvF783P0swUwCog0vPeL9xyPvBY6mV7c9V2opp/39zfC67Yox/9Ggg== X-YMail-OSG: bgWZDxAVM1n7lF5MjCn4kko5czP_yjQa48stoWXXakhBbLUY0md1ruQEfI05CB1 ZpDmJ3qBUNTKkY.8pk2tD7m6y6EI8b4cIceeB_nP6T0jD35mXN0S.uGKckQbBNDXG.7O2viIKpsC sy5Fa1kU2mFqAJmx7MdXe4f5CiHlHI3dyaj_ry7O.GdsRSWbdjyY0nWZgWVPEznwVnz_WMq.cmqe AJaLXgrfKEE1XaqbDz8myaePyzE3Uzc2B8CSkN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x2vz6NtDh_vM7qLpNSd.m2hv.oQeQGAzv_Hqyy Nvas_BCToW0LXVnJtOtKeDbNpISPwJyCaPh_rVDS88aevXikFhoio6mR1PPuT6XKMPtUuTrzyfVy Xvq4CW613738wyXkbBnLYxdhsML4PMvyyg2neJD4P1GdnWQEnMFpDIFR1AxrRTCsKkkMuSJ3JKUk lh7ea8ZglsXnpWiaJXa2SE4jHhKgv2xzGWYb2SknWkGl0JMfdNNtNe9xaJ.UdPMyYCA5zsx91FNV 5bNM4JZW__EPu19GXMYfHRAyusiKIdIY5A6Kk8OUpNbYsZsi_XEY2QCLVLpfdK05Hc4ty92DgnRk 4ASyBgou4QEz3ocFfUsQuhJ0BVwy9QCLzXZ0SPrbL28gmf_9OHbdK.nRX2KgIpjpYuubi5baqutV 5cl19zAhXNqHa_2TBh42b1RYtiHI2.bVAIrFG7osUJFziyiYZ4HbCgClOgPA9Oe3cua_BKkGVQ9D lr1aVFYNCjaJkG0Ag.Yps2TTQ3Q0Wc.MXGUj.vdkpfwXErfN7njdmFqlZTsRvGfAPsp.8SOxr0fO LiELEpxVqIBhLmL.zUuvk3VsZQ4Uuj8pbCb9JkyPEVXRiLXIu8FWhixZgMszSC.jC7n6bg7pL3ft PJQPU8YENZSJmsixEBBViryWw.S4pbggSJkwBj34ECmcMU9TqyFZo6BSDQw2Ai.QXRqChmE8h4Th 1RG6MVeC6YToKucv1vlLoBGS0H7JsaHjCjBaaWthOS4.Cu7ME7LJMPmJye5_nQtrlAuhNDIb5qXE wMJQaC6OPwX2EXu4cU0dxiahXWm9mawJbTgSAFJOsy3isZhmS3nEZrJq8To.BMrE7RvP5oYRr_U9 ZvJBrwpeIQ630EvhJEve98P92LiWRSg-- X-Sonic-MF: Received: from sonic.gate.mail.ne1.yahoo.com by sonic303.consmr.mail.ir2.yahoo.com with HTTP; Wed, 11 May 2022 08:02:09 +0000 Date: Wed, 11 May 2022 08:05:55 +0000 (UTC) From: Nikita Pavlov To: "openbmc@lists.ozlabs.org" Message-ID: <1672954866.3142932.1652256355764@mail.yahoo.com> In-Reply-To: <93960ad8-105b-fc06-b5e8-a4f2c443c473@linux.intel.com> References: <1790304102.3756861.1651157909253.ref@mail.yahoo.com> <1790304102.3756861.1651157909253@mail.yahoo.com> <667725503.727721.1651325136829@mail.yahoo.com> <93960ad8-105b-fc06-b5e8-a4f2c443c473@linux.intel.com> Subject: Re: x86-power-control question: front panel buttons dont work MIME-Version: 1.0 Content-Type: multipart/alternative; boundary="----=_Part_3142931_1805525701.1652256355761" X-Mailer: WebService/1.1.20188 YMailNorrin X-BeenThere: openbmc@lists.ozlabs.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Development list for OpenBMC List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: openbmc-bounces+openbmc=archiver.kernel.org@lists.ozlabs.org Sender: "openbmc" ------=_Part_3142931_1805525701.1652256355761 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable Hi Jason,=C2=A0 Front panel stop working from there until the next=C2=A0reboot even after s= topping gpioset. I test it with getting POWER_OUT line value and then released line like thi= s: #include #include int main(int argc, char** argv){=C2=A0 =C2=A0 gpiod::line line =3D gpiod::f= ind_line("POWER_OUT");=C2=A0 =C2=A0 if (!line)=C2=A0 =C2=A0 {=C2=A0 =C2=A0 = =C2=A0 =C2=A0 std::cerr << "find line error\n";=C2=A0 =C2=A0 =C2=A0 =C2=A0 = return -1;=C2=A0 =C2=A0 } =C2=A0 =C2=A0 try=C2=A0 =C2=A0 {=C2=A0 =C2=A0 =C2=A0 =C2=A0 line.request({"= pwr", gpiod::line_request::EVENT_BOTH_EDGES, {}});=C2=A0 =C2=A0 }=C2=A0 =C2= =A0 catch (const std::exception& ec)=C2=A0 =C2=A0 {=C2=A0 =C2=A0 =C2=A0 =C2= =A0 std::cerr << ec.what();=C2=A0 =C2=A0 } =C2=A0 =C2=A0 int state =3D line.get_value();=C2=A0 =C2=A0 std::cout << sta= te << '\n';=C2=A0 =C2=A0 line.release(); =C2=A0 =C2=A0 return 0;} But front panel button also doesnt work with getting value. -- Best regards, Nikita Pavlov, NUST MISiS Student =20 =D0=BF=D0=BE=D0=BD=D0=B5=D0=B4=D0=B5=D0=BB=D1=8C=D0=BD=D0=B8=D0=BA, 2 = =D0=BC=D0=B0=D1=8F 2022 =D0=B3., 18:36:24 GMT+3, Bills, Jason M =D0=BD=D0=B0=D0=BF=D0=B8=D1=81=D0=B0=D0=BB(-=D0=B0): = =20 =20 Hi Nikita, On 4/30/2022 7:25 AM, Nikita Pavlov wrote: > Hi Jason, thank you for your response. In my platform I have=20 > power-control gpios in GPIOD group like this: >=20 > /*D0-D7*/ "POWER_BUTTON","POWER_OUT","RESET_BUTTON","RESET_OUT", >=20 > Also I configurate pass-through mode in dts: >=20 >=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 pinctrl-names =3D "pass-through"; >=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 pinctrl-0 =3D <&pinctrl_gpid0_default >=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2= =A0 =C2=A0 =C2=A0 =C2=A0=C2=A0=C2=A0=C2=A0&pinctrl_gpid2_default>; Could you please share what is your BMC hardware version? >=20 > After update and reboot platform I have same problem - front panel=20 > buttons dont enable (front panel buttons dont enable if I use=20 > x86-power-control module or manually set gpio values by gpioset utility). > But if I dont use any impacts on gpio (disable x86-power-control module= =20 > and dont use gpio utilities like gpioset/get) front panel buttons work we= ll. >=20 > What are your assumptions about this ? The pass-through is set up as a mux in pinctrl.=C2=A0 If I remember=20 correctly, the output pin has GPIO output and pass-through mode as two=20 different options in the pinctrl mux. So, when you request the output pin using libgpiod, it automatically=20 configures the pinctrl to disable the pass-through. You should be able=20 to re-enable pass-through by simply releasing control of the output pin=20 in libgpiod. For simplicity, let's work with just the gpioset utility and not use=20 x86-power-control.=C2=A0 So, when you initially boot, the pass-through is= =20 working. You then use gpioset to change the output pin (which will=20 switch the pinctrl mux and disable pass-through mode causing the front=20 panel to stop working). When you stop gpioset, it should release the=20 gpio and switch the mux back to enable pass-through mode for the front=20 panel to work again. In your test does the front panel start working again after stopping=20 gpioset? Or does the front panel stop working from there until the next=20 reboot even after stopping gpioset? Thanks, -Jason >=20 >=20 >=20 > -- > Best regards, > Nikita Pavlov, > NUST MISiS Student >=20 >=20 >=20 > =D1=87=D0=B5=D1=82=D0=B2=D0=B5=D1=80=D0=B3, 28 =D0=B0=D0=BF=D1=80=D0=B5= =D0=BB=D1=8F 2022 =D0=B3., 23:01:13 GMT+3, Bills, Jason M=20 > =D0=BD=D0=B0=D0=BF=D0=B8=D1=81=D0=B0=D0=BB(-=D0= =B0): >=20 >=20 > Hi Nikita, >=20 > In the hardware, we have the power button routed through a GPIO=20 > pass-through on the Aspeed chip.=C2=A0 If that pass-through is disabled, = it=20 > will prevent the physical front panel button signal from getting past=20 > the BMC.=C2=A0 That is the first thing I would check. >=20 > Also, it is better to send these kinds of questions to the OpenBMC=20 > mailing list as there may be others in the community in a similar situati= on. >=20 > Thanks, >=20 > -Jason >=20 > *From:* Nikita Pavlov > *Sent:* Thursday, April 28, 2022 8:58 AM > *To:* Bills, Jason M ; kuiying.wang@intel.com > *Subject:* x86-power-control question: front panel buttons dont work >=20 > Hi, I user x86-power-control module for my test intel platform. Its=20 > module works in webui but front panel physical buttons doesnt work. I=20 > think that it interface describe in this fragment=20 > https://github.com/openbmc/x86-power-control/blob/master/src/power_contro= l.cpp#L3072=20 > =C2=A0but=20 > I cant understand this logic. >=20 > Say me pls, why front panel buttons dont work ? >=20 > -- > Best regards, > Nikita Pavlov, > NUST MISiS Student >=20 =20 ------=_Part_3142931_1805525701.1652256355761 Content-Type: text/html; charset=UTF-8 Content-Transfer-Encoding: quoted-printable
Hi Jason, 

Front panel stop working from = there until the next reboot even after stopping gpioset.=

I test it with getting POWER_OUT line value and t= hen released line like this:

#include <gpiod.hpp>

= #include <iostream>

int main(int argc, char*= * argv)
{
    gpiod::line line =3D gpiod::fin= d_line("POWER_OUT");
    if (!line)
  &n= bsp; {
        std::cerr << "find line = error\n";
        return -1;
 =   }

    try
   = ; {
        line.request({"pwr", gpiod::line_= request::EVENT_BOTH_EDGES, {}});
    }
 =   catch (const std::exception& ec)
    {
        std::cerr << ec.what();
&= nbsp;   }

    int state =3D line.ge= t_value();
    std::cout << state << '\n';<= /div>
    line.release();

  &nb= sp; return 0;
}


But front= panel button also doesnt work with getting value.

--
Best regards,
Nikita Pavlov,
NUST MISiS Student



=20
=20
=D0=BF=D0=BE=D0=BD=D0=B5=D0=B4=D0=B5=D0=BB=D1=8C=D0=BD= =D0=B8=D0=BA, 2 =D0=BC=D0=B0=D1=8F 2022 =D0=B3., 18:36:24 GMT+3, Bills, Jas= on M <jason.m.bills@linux.intel.com> =D0=BD=D0=B0=D0=BF=D0=B8=D1=81= =D0=B0=D0=BB(-=D0=B0):


Hi Nikita,

On 4/30/2022 7:25 AM, Nikita Pavlov wrote:
>= ; Hi Jason, thank you for your response. In my platform I have
> power-control gpios in GPIOD group like this:
>
> /*D0-D7*/ "POWER_BUTTON","POWER_OUT","RESET_B= UTTON","RESET_OUT",
>
> Also I c= onfigurate pass-through mode in dts:
>
>          pinctrl-names =3D "pass-through"= ;
>          pinctrl-0 =3D &l= t;&pinctrl_gpid0_default
>      &nb= sp;                    &n= bsp;  &pinctrl_gpid2_default>;

Could you please share what is your BMC hardware version?
>
> After update and reboot platform I = have same problem - front panel
> buttons dont enable= (front panel buttons dont enable if I use
> x86-powe= r-control module or manually set gpio values by gpioset utility).
> But if I dont use any impacts on gpio (disable x86-power-con= trol module
> and dont use gpio utilities like gpiose= t/get) front panel buttons work well.
>
> What are your assumptions about this ?

The pass-through is set up as a mux in pinctrl.  If I remem= ber
correctly, the output pin has GPIO output and pass-t= hrough mode as two
different options in the pinctrl mux.=

So, when you request the output pin u= sing libgpiod, it automatically
configures the pinctrl t= o disable the pass-through. You should be able
to re-ena= ble pass-through by simply releasing control of the output pin
in libgpiod.

For simplicity, le= t's work with just the gpioset utility and not use
x86-p= ower-control.  So, when you initially boot, the pass-through is
working. You then use gpioset to change the output pin (which = will
switch the pinctrl mux and disable pass-through mod= e causing the front
panel to stop working). When you sto= p gpioset, it should release the
gpio and switch the mux= back to enable pass-through mode for the front
panel to= work again.

In your test does the fro= nt panel start working again after stopping
gpioset? Or = does the front panel stop working from there until the next
reboot even after stopping gpioset?

Thanks,

= -Jason

>
> >
> --
> Bes= t regards,
> Nikita Pavlov,
> NUS= T MISiS Student
>
>
>
> =D1=87=D0=B5=D1=82=D0=B2=D0=B5=D1=80=D0= =B3, 28 =D0=B0=D0=BF=D1=80=D0=B5=D0=BB=D1=8F 2022 =D0=B3., 23:01:13 GMT+3, = Bills, Jason M
> <jason.= m.bills@intel.com> =D0=BD=D0=B0=D0=BF=D0=B8=D1=81=D0=B0=D0=BB(-=D0= =B0):
>
>
>= ; Hi Nikita,
>
> In the hardware= , we have the power button routed through a GPIO
> pa= ss-through on the Aspeed chip.  If that pass-through is disabled, it <= br clear=3D"none">> will prevent the physical front panel button signal = from getting past
> the BMC.  That is the first = thing I would check.
>
> Also, i= t is better to send these kinds of questions to the OpenBMC
> mailing list as there may be others in the community in a similar = situation.
>
> Thanks,
>
> -Jason
>
> *From:* Nikita Pavlov <niikita@yahoo.com= >
> *Sent:* Thursday, April 28, 2022 8:58 AM> *To:* Bills, Jason M <jas= on.m.bills@intel.com>; kuiying.wang@intel.co= m
> *Subject:* x86-power-control question: front p= anel buttons dont work
>
> Hi, I= user x86-power-control module for my test intel platform. Its
> module works in webui but front panel physical buttons doesnt w= ork. I
> think that it interface describe in this fra= gment
> https://github.com/openbmc/x86-power-control/blob/master/src/po= wer_control.cpp#L3072
> <https://github.com/openbmc/x86-power-cont= rol/blob/master/src/power_control.cpp#L3072> but
> I cant understand this logic.
>
> Say me pls, why front panel buttons dont work ?
>
> --
> Best regards,
> Nikita Pavlov,
> NUST MISiS Studen= t
>
------=_Part_3142931_1805525701.1652256355761--