Received: by 2002:ac0:a582:0:0:0:0:0 with SMTP id m2-v6csp490844imm; Mon, 1 Oct 2018 13:19:10 -0700 (PDT) X-Google-Smtp-Source: ACcGV63+bzZXzqS6hsQpNEoTEl8T/RGc0M3pU44DqnnzjCh8bZV+s88rB9hKJg9tHoqqvKKgUePu X-Received: by 2002:a17:902:9a0c:: with SMTP id v12-v6mr13424126plp.159.1538425150543; Mon, 01 Oct 2018 13:19:10 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1538425150; cv=none; d=google.com; s=arc-20160816; b=q/oKaSdPIfMarvbrmP19gSJOUBuoy4DYJDbHbkkFqf2aRHWH6k3lIuupkMfoLY+YLb E1dCUsDqZViY5pMItw9u/abGxw5bsz+qFovbneZQY21fKFEPgVUqs1ZDEXQuGV8mjLlY MPG6C1wx00BcQ58c6x7bjrzaNAtpkkrtVSk/rc0ugQnRkA6HDl85JzqEt9Q47mmJId+i sqB94/XHPUaSTafTaidJi+hkD6sR44xsP9D0eQIzCiFIiNq4m0ccmgKBRKhrpgQ6blbA vJ0AYrltlVplZtn2pcSh4UYqb/JrAce2NkRPq/xir2AKgtJuMEZSAVXcBmAz/dFbdzHO hjJQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:dkim-signature; bh=mEsiSruzq3xfSNbpG6aqyL0GFc/jYw/djP3g2ZpcJGw=; b=pVSnmCJGfSgsAm16/iWZIvocMk5puKNVlGRwszppVFiyWTfguA08dZnLrEdaG5Y9+U 4BC7+rU0hM9E9ze2afQQqyEI+DU8ecks2qLf1eeXxAFOVi9/EfdIM2AP6O4xWn2+qcWR aL3a1H3y7RVVmFuTryN3YnxSVSCJZ8Borfu9/KjRrcVcUK+LKjJeMU8KXspUwkRKHtt8 Jnz/PSMGmA6vF+1JebG/79BBqi13WnyUVBFzIiK+Hgu7q0t0Udoscl138AiqCWIHSWJf 16iwrE3tP+B+VsrT8XnTP//0rbEC4vYA48+P2LwLfj6Uk/lLiq0XQW9dhFWARqwRoxbi EXFA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=aOPcpB9K; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id d12-v6si13373740pla.421.2018.10.01.13.18.55; Mon, 01 Oct 2018 13:19:10 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=aOPcpB9K; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726308AbeJBC4d (ORCPT + 99 others); Mon, 1 Oct 2018 22:56:33 -0400 Received: from mail-it1-f195.google.com ([209.85.166.195]:38035 "EHLO mail-it1-f195.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725948AbeJBC4d (ORCPT ); Mon, 1 Oct 2018 22:56:33 -0400 Received: by mail-it1-f195.google.com with SMTP id i76-v6so122462ita.3 for ; Mon, 01 Oct 2018 13:17:03 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=mEsiSruzq3xfSNbpG6aqyL0GFc/jYw/djP3g2ZpcJGw=; b=aOPcpB9KTdxa25QIZ25XDAV4LZqAy0tU3nyHSeS0Hi1fV6POvxKh5hVSvI2locY3mS VYR1lns+QO7NjSQ2ULiUW5ao6PkesheDqHB+vawDKWnE7a9YP25hrwQn/d7w14QIBGdy CCgk2reUc3mBa+Ql8LNR+lpFawnyPPVIw3RiM= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=mEsiSruzq3xfSNbpG6aqyL0GFc/jYw/djP3g2ZpcJGw=; b=pRDlJ50Y7SU4hh6cvc5MIou/rXSKdqVVZr6MSDTQtGcLCdA76s0wXITl8g8c0Td07C cU+K9hbCKicHhpT2kdu5plro+8i9xJDBeKWZtRzSSZyMQOrsrS6VRgzxagV5/NOrba3M Jfg9CcKWh+rPELCCTrXNkKaFpks/8h2QGVhXrcbxRfhYfVkrD8sotJGOeAQf+4GI8SFM DjrPwFzy+WVK296IuR59OFR1gjUnrRvH8Qb97Nk+yojZV20qQKWGfMnXQAU9FJfhsdfq Ox/Dtv5NZby3iuOR79DPcld1uhisEuGCcVM40efyurmCCYXn5OixAIMuUKvsIvtiYs0r rwPw== X-Gm-Message-State: ABuFfoi3BQuZ22l7+bndjArO9qWw61sOn6YXw96Pw0PjKM/0HB7WCCWL ONYXC0kyYb9UoEQW2lFdini93DodbMvcQcJSdD94aQ== X-Received: by 2002:a02:3d8e:: with SMTP id n136-v6mr3454928jan.87.1538425023158; Mon, 01 Oct 2018 13:17:03 -0700 (PDT) MIME-Version: 1.0 References: <20180906122436.25610-1-linus.walleij@linaro.org> In-Reply-To: From: Linus Walleij Date: Mon, 1 Oct 2018 22:16:51 +0200 Message-ID: Subject: Re: [PATCH v7] regulator: fixed: Convert to use GPIO descriptor only To: leonard.crestez@nxp.com, John Stultz Cc: Mark Brown , "linux-kernel@vger.kernel.org" , Andy Duan , Fabio Estevam , "open list:GPIO SUBSYSTEM" , Liam Girdwood , Shawn Guo , Anson Huang , ext Tony Lindgren , Mike Rapoport , Janusz Krzysztofik Content-Type: text/plain; charset="UTF-8" Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Mon, Oct 1, 2018 at 8:53 PM Leonard Crestez wrote: > This patch seems to break network booting on imx6sx-sdb in linux-next > because the enet phy regulator is not on. Reverting the patch fixes > boot. Thanks for reporting. John Stultz reported the same problem I'm trying to debug it. > Here is the regulator definition: > > reg_enet_3v3: regulator-enet-3v3 { > compatible = "regulator-fixed"; > pinctrl-names = "default"; > pinctrl-0 = <&pinctrl_enet_3v3>; > regulator-name = "enet_3v3"; > regulator-min-microvolt = <3300000>; > regulator-max-microvolt = <3300000>; > gpios = <&gpio2 6 GPIO_ACTIVE_LOW>; > }; This is a bit odd actually, the GPIO_ACTIVE_LOW flag will be ignored as you see: > [ 0.153171] reg_fixed_voltage_probe(179): regulator-enet-3v3 call gpiod_get_optional gflags=0x7 ena_gpio_invert > [ 0.153218] regulator-enet-3v3 GPIO handle specifies active low - ignored > [ 0.153233] of_gpio_flags_quirks(83): regulator-enet-3v3 set active low because !enable-active-high Because regulators don't specify active high/low in the second cell because of legacy bindings. So this should not be in the device tree anyway, it should be GPIO_ACTIVE_HIGH or just 0. > That "gpio_value: 30 set 1" tracepoint is wrong, the line is set high. > > It seems that gpiod_set_value will check FLAG_ACTIVE_LOW and > automatically invert (...) >so maybe ena_gpio_invert should not be used if a > full gpiod is passed to regulator? (...) > - cfg.ena_gpio_invert = !config->enable_high; Indeed. I will look closer so it's the right fix and provide a patch. > All these high/low inversions and flags are extremely confusing to me. Yeah it's what I'm trying to get rid of with these patches, this is just the first patch in a series that move inversion over to the GPIO library. Yours, Linus Walleij