linux-arm-kernel.lists.infradead.org archive mirror
 help / color / mirror / Atom feed
From: "Russell King (Oracle)" <linux@armlinux.org.uk>
To: lizhe <sensor1010@163.com>
Cc: Andrew Lunn <andrew@lunn.ch>,
	andrew+netdev@lunn.ch, davem@davemloft.net, edumazet@google.com,
	kuba@kernel.org, pabeni@redhat.com, mcoquelin.stm32@gmail.com,
	alexandre.torgue@foss.st.com, vladimir.oltean@nxp.com,
	maxime.chevallier@bootlin.com, netdev@vger.kernel.org,
	linux-stm32@st-md-mailman.stormreply.com,
	linux-arm-kernel@lists.infradead.org,
	linux-kernel@vger.kernel.org
Subject: Re: Re: Re: Re: Re: [PATCH] net: stmmac: Support gpio high-level reset for devices requiring it
Date: Wed, 9 Jul 2025 18:41:59 +0100	[thread overview]
Message-ID: <aG6p5_p9CmqxZcxM@shell.armlinux.org.uk> (raw)
In-Reply-To: <2352b745.a454.197efeef829.Coremail.sensor1010@163.com>

On Thu, Jul 10, 2025 at 12:05:05AM +0800, lizhe wrote:
> Hi,
> 
>      
> 
>   if i add the following code to this function, the gpio outputs a high level
> 
>   without this code, it outputs a low level, 
>   the function currently drivers the reset GPIO to a low state, failing to account 
> 
>   for devices requiring an active-high reset.
> 
> 
> 
> 
>   i invited our hardware engineer to  measure the voltage level on this GPIO pin,
> 
>   without  adding this code, the voltage at this GPIO pin remains at 0V
> 
> 
> 
> 
>   +             int current_value;
> 
> 
> 
> 
>   +             keep_high = device_property_read_bool(priv->device,
> 
>   +                                                             "snps,reset-keep-high");
> 
>   +              if (keep_high) {
> 
>   +                     gpiod_set_value_cansleep(reset_gpio, 1);
> 
>   +                      current_value = gpiod_get_value_cansleep(reset_gpio);
> 
>   +                      pr_info("current_value: %d\n", current_value);
> 
>   +              }
> 
>    in the RK3588 system, i am using ,there are many DTS node configured link this:
> 
>     snps, reset-gpio = <&gpioX RK_PXX GPIO_ACTIVE_HIGH>;   
>     All of them correctly parse the GPIO pin's state are described in the DTS
> 

I'm wondering at this point whether the problem here is one of
mis-understanding the engineering terminology. Look at the below
using a fixed-width font:

Active-high reset: _____/^^^^^^^^\____

Active-low reset:  ^^^^^\________/^^^^

                        | reset  |
			|asserted|

So, an active high reset needs to be logic low in order for the
device to function. An active low reset needs to be logic high
for the device to function.

You seem to be wanting to tell the kernel that you have an
active high reset, and expect it to be logic high when you
want it to be active. That is *not* an active high reset.

-- 
RMK's Patch system: https://www.armlinux.org.uk/developer/patches/
FTTP is here! 80Mbps down 10Mbps up. Decent connectivity at last!


  parent reply	other threads:[~2025-07-09 21:58 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-07-08 16:50 [PATCH] net: stmmac: Support gpio high-level reset for devices requiring it Lizhe
2025-07-08 17:34 ` Andrew Lunn
     [not found]   ` <5c7adfef.1876.197ece74c25.Coremail.sensor1010@163.com>
2025-07-09  4:26     ` Russell King (Oracle)
     [not found]       ` <5bb49dc0.6933.197ee28444e.Coremail.sensor1010@163.com>
2025-07-09 11:11         ` Russell King (Oracle)
     [not found]           ` <4cfb4aab.9588.197eefef55f.Coremail.sensor1010@163.com>
2025-07-09 14:29             ` Russell King (Oracle)
     [not found]               ` <2352b745.a454.197efeef829.Coremail.sensor1010@163.com>
2025-07-09 17:01                 ` Andrew Lunn
2025-07-09 17:41                 ` Russell King (Oracle) [this message]
2025-07-09 12:54     ` Andrew Lunn
2025-07-08 17:40 ` Russell King (Oracle)
     [not found]   ` <2588871d.189d.197ece7c486.Coremail.sensor1010@163.com>
2025-07-09  4:25     ` Russell King (Oracle)

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=aG6p5_p9CmqxZcxM@shell.armlinux.org.uk \
    --to=linux@armlinux.org.uk \
    --cc=alexandre.torgue@foss.st.com \
    --cc=andrew+netdev@lunn.ch \
    --cc=andrew@lunn.ch \
    --cc=davem@davemloft.net \
    --cc=edumazet@google.com \
    --cc=kuba@kernel.org \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-stm32@st-md-mailman.stormreply.com \
    --cc=maxime.chevallier@bootlin.com \
    --cc=mcoquelin.stm32@gmail.com \
    --cc=netdev@vger.kernel.org \
    --cc=pabeni@redhat.com \
    --cc=sensor1010@163.com \
    --cc=vladimir.oltean@nxp.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).