From patchwork Tue Nov 5 20:35:51 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Andy Shevchenko X-Patchwork-Id: 178555 Delivered-To: patch@linaro.org Received: by 2002:a92:38d5:0:0:0:0:0 with SMTP id g82csp1268557ilf; Tue, 5 Nov 2019 12:36:06 -0800 (PST) X-Google-Smtp-Source: APXvYqyTiE5lQnG67vb2fGj2lJhXwvfFpP2b3xN1mvZ8wSbMQS2oHqrxBIbUoxFVUzC1MU0yv79R X-Received: by 2002:a17:906:d795:: with SMTP id pj21mr3123020ejb.44.1572986166046; Tue, 05 Nov 2019 12:36:06 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1572986166; cv=none; d=google.com; s=arc-20160816; b=EhewkNonaE4xwqANduoCn0fYv7wgKG965rBRvA2QeT654zM31y1cIrcfn77EifeagP zItBo2thad862MaUhI+0l19+P0eRNv/V9Fg11VBj4NEwv+dP+4EtTB4kqQDlYRapPWPY J2DIuODlkKa3z8U3e2jLMwNSDJVuylwb4bpfcXAHQIupKHcoAqKXWl4FSSrlT/hsA72Q XkKB07SLwW9A+DOouW8Hw6I/ZsauTycVnXPfGqAkOq0LQvblJht6g0wcQNGVakAeIlOi WDSkVMYeqnJR1OyKflI8M/rgTaz+RlRyKkycw7akS9R330rU0KZCI4QGdbUsuHG0Y2Lj wpNw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from; bh=GMRJO12fCxdU1imzIAyZneVzQvkFoFLUuVbuC3AEbyY=; b=EmWgpoUDj2em1HOwM2iT8SSRa1XMhQ+vBibyxKT3/bGXs74hUi8RNSvEOjqPobXv36 xmpBWPiSVvUb7HiH8oW6X3IHnEapAbj8HZpcOU0hpcXhu1QUk190WoUXtBeVZEEh5c5j 1/n49Egwn13OMtGDVk934eNrDa7lRry2sFvQI0b7VSRuVXYFRMC9bKSgb01JEp7gPxFo 6OXFXLBiLFKwIiKu470gEql/uW0rhQq4gRKSG9FY/8oveAujKs9aG+1dW0Ohcmc9QtCO mq39S4fzNc5WCBZT06ZnILRZMwR/x2OFrOBVBLfhSGa3+BF3AvUDKCNfEHc7/IR+1XFa srTw== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-gpio-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-gpio-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=intel.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id q8si11285349edi.445.2019.11.05.12.36.05; Tue, 05 Nov 2019 12:36:06 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-gpio-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-gpio-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-gpio-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=intel.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1729594AbfKEUgD (ORCPT + 5 others); Tue, 5 Nov 2019 15:36:03 -0500 Received: from mga04.intel.com ([192.55.52.120]:41970 "EHLO mga04.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1729735AbfKEUgD (ORCPT ); Tue, 5 Nov 2019 15:36:03 -0500 X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from orsmga006.jf.intel.com ([10.7.209.51]) by fmsmga104.fm.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 05 Nov 2019 12:36:02 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.68,271,1569308400"; d="scan'208";a="205625023" Received: from black.fi.intel.com ([10.237.72.28]) by orsmga006.jf.intel.com with ESMTP; 05 Nov 2019 12:36:00 -0800 Received: by black.fi.intel.com (Postfix, from userid 1003) id AB7A0D4; Tue, 5 Nov 2019 22:35:59 +0200 (EET) From: Andy Shevchenko To: Bartosz Golaszewski , Linus Walleij , linux-gpio@vger.kernel.org, Mika Westerberg , Hans de Goede Cc: Andy Shevchenko Subject: [PATCH v2 1/7] gpiolib: Switch order of valid mask and hw init Date: Tue, 5 Nov 2019 22:35:51 +0200 Message-Id: <20191105203557.78562-2-andriy.shevchenko@linux.intel.com> X-Mailer: git-send-email 2.24.0.rc1 In-Reply-To: <20191105203557.78562-1-andriy.shevchenko@linux.intel.com> References: <20191105203557.78562-1-andriy.shevchenko@linux.intel.com> MIME-Version: 1.0 Sender: linux-gpio-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-gpio@vger.kernel.org From: Linus Walleij The GPIO irqchip needs to initialize the valid mask before initializing the IRQ hardware, because sometimes the latter require the former to be executed first. Fixes: 9411e3aaa634 ("gpiolib: Initialize the hardware with a callback") Cc: Andy Shevchenko Cc: Mika Westerberg Reported-by: Hans de Goede Signed-off-by: Linus Walleij Acked-by: Hans de Goede Reviewed-by: Andy Shevchenko Reviewed-by: Mika Westerberg Signed-off-by: Andy Shevchenko --- drivers/gpio/gpiolib.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) -- 2.24.0.rc1 diff --git a/drivers/gpio/gpiolib.c b/drivers/gpio/gpiolib.c index b306dfa789e9..a13f656c3034 100644 --- a/drivers/gpio/gpiolib.c +++ b/drivers/gpio/gpiolib.c @@ -1411,11 +1411,11 @@ int gpiochip_add_data_with_key(struct gpio_chip *chip, void *data, machine_gpiochip_add(chip); - ret = gpiochip_irqchip_init_hw(chip); + ret = gpiochip_irqchip_init_valid_mask(chip); if (ret) goto err_remove_acpi_chip; - ret = gpiochip_irqchip_init_valid_mask(chip); + ret = gpiochip_irqchip_init_hw(chip); if (ret) goto err_remove_acpi_chip;