From patchwork Tue Apr 20 08:42:26 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Neil Armstrong X-Patchwork-Id: 1468251 X-Patchwork-Delegate: trini@ti.com Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=lists.denx.de (client-ip=85.214.62.61; helo=phobos.denx.de; envelope-from=u-boot-bounces@lists.denx.de; receiver=) Authentication-Results: ozlabs.org; dkim=pass (2048-bit key; unprotected) header.d=baylibre-com.20150623.gappssmtp.com header.i=@baylibre-com.20150623.gappssmtp.com header.a=rsa-sha256 header.s=20150623 header.b=zSQrbK9M; dkim-atps=neutral Received: from phobos.denx.de (phobos.denx.de [85.214.62.61]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 4FPcdn3CKXz9t1r for ; Tue, 20 Apr 2021 18:43:09 +1000 (AEST) Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id C28A282B1C; Tue, 20 Apr 2021 10:42:54 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=none (p=none dis=none) header.from=baylibre.com Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=u-boot-bounces@lists.denx.de Authentication-Results: phobos.denx.de; dkim=pass (2048-bit key; unprotected) header.d=baylibre-com.20150623.gappssmtp.com header.i=@baylibre-com.20150623.gappssmtp.com header.b="zSQrbK9M"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id 3FF4082AFF; Tue, 20 Apr 2021 10:42:39 +0200 (CEST) X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on phobos.denx.de X-Spam-Level: X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,SPF_HELO_NONE autolearn=ham autolearn_force=no version=3.4.2 Received: from mail-wm1-x32c.google.com (mail-wm1-x32c.google.com [IPv6:2a00:1450:4864:20::32c]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits)) (No client certificate requested) by phobos.denx.de (Postfix) with ESMTPS id 39C9E82AD8 for ; Tue, 20 Apr 2021 10:42:31 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=none (p=none dis=none) header.from=baylibre.com Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=narmstrong@baylibre.com Received: by mail-wm1-x32c.google.com with SMTP id w7-20020a1cdf070000b0290125f388fb34so19558041wmg.0 for ; Tue, 20 Apr 2021 01:42:31 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=baylibre-com.20150623.gappssmtp.com; s=20150623; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=IkaK9iisGAwcyQj55uc1H4g47vvqMB926glhDPyhSrw=; b=zSQrbK9MlynIW4rFCUzHzpjWUw0Ar6YBjtfLgwQDGFBrfnCTeAkbS58aYX9HVd986e UGdRKrxeuPLk5OA4s1OD/o/tVTV1F+VPur7IuGfx9NCZvf9gFHlucnpXUhsNTLxsmpFH fsuVqCqiA/+B80pmV1K4SuwsTF/pH+hoU89JccPdUqThH1fu+xdzeNLOeG9jfIvLPkP5 sNLa1faKaMpM2gdZgaHTcm0tL0St74/9IG/6vsWXdjZbw9KZXoMaa2y6vGb2DmWyhaAO n0G/gvD+TfyyAdjRmRqOOpyYVluFQPZmIbe0ZVI1CjuNOCPpZlPXqw1oYufuUGooNA4n usBg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=IkaK9iisGAwcyQj55uc1H4g47vvqMB926glhDPyhSrw=; b=nTyTha58SMv6g2sRXtwPNQK81zwzJLu0VLKcuBk2L3lbDjOEfAKVludS0TyGbwj420 70DCouIgXEfjnbDVISjL+BO3/hyOELi8CZsfiackyjM+9XcvAv8vhhstNVgIibDagoMN /KcetExekIuT+AqUQ87OdZ3xEMg9gZY+Tf9dM6tELLpLwSCuEk0UXtyFHFssHP+iWvZL zeRipAs0fAAfLPqSneJ/xW+w2E/WWyJfDmG4WIY1anaq6+4ANV4jKPQcGJ5+yKEAQjbU P2oZXcgqDlsz3LkORVkKpIg1wl+1jnnsLKXTyohqtujyqUGxgbeSt0kia9ZQZQe+xLgJ cxVQ== X-Gm-Message-State: AOAM530WnG5CO3ibYmyIN6Kh1fwcVogYqbLUs6/VNwnJsYcn8QWYjr8v sFrejOqn0BCh21j66BFoOw77ZQ== X-Google-Smtp-Source: ABdhPJyKifj8cIv5ukSPps1uf8mWG1JtIeqNczTxQ2AKIF89SMeWg3NYaVWjHo7jslnaPxIy6rhWNw== X-Received: by 2002:a05:600c:2dc8:: with SMTP id e8mr3218968wmh.10.1618908150704; Tue, 20 Apr 2021 01:42:30 -0700 (PDT) Received: from bojack.baylibre.local (laubervilliers-658-1-213-31.w90-63.abo.wanadoo.fr. [90.63.244.31]) by smtp.gmail.com with ESMTPSA id a2sm27440510wrt.82.2021.04.20.01.42.29 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 20 Apr 2021 01:42:30 -0700 (PDT) From: Neil Armstrong To: sjg@chromium.org Cc: jagan@amarulasolutions.com, u-boot@lists.denx.de, trini@konsulko.com, u-boot-amlogic@groups.io, Neil Armstrong , B1oHazard Subject: [PATCH 2/2] reset: fix reset_get_by_index_nodev index handling Date: Tue, 20 Apr 2021 10:42:26 +0200 Message-Id: <20210420084226.2996654-3-narmstrong@baylibre.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20210420084226.2996654-1-narmstrong@baylibre.com> References: <20210420084226.2996654-1-narmstrong@baylibre.com> MIME-Version: 1.0 X-BeenThere: u-boot@lists.denx.de X-Mailman-Version: 2.1.34 Precedence: list List-Id: U-Boot discussion List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: u-boot-bounces@lists.denx.de Sender: "U-Boot" X-Virus-Scanned: clamav-milter 0.102.4 at phobos.denx.de X-Virus-Status: Clean This fixes an issue getting resets index 1 and 3+, the spurius "> 0" made it return the index 0 or 1, whatever index was passed. The dm_test_reset_base() did not catch it, but the dm_test_reset_base() extension catches it and this fixes the regression. This also fixes a reggression on Amlogic G12A/G12B SoCs, where HDMI output was disable even when Linux was booting. Fixes: ea9dc35aab ("reset: Get the RESET by index without device") Reported-by: B1oHazard Signed-off-by: Neil Armstrong --- drivers/reset/reset-uclass.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/reset/reset-uclass.c b/drivers/reset/reset-uclass.c index 071c389ca0..ac89eaf098 100644 --- a/drivers/reset/reset-uclass.c +++ b/drivers/reset/reset-uclass.c @@ -95,7 +95,7 @@ int reset_get_by_index_nodev(ofnode node, int index, int ret; ret = ofnode_parse_phandle_with_args(node, "resets", "#reset-cells", 0, - index > 0, &args); + index, &args); return reset_get_by_index_tail(ret, node, &args, "resets", index > 0, reset_ctl);