From patchwork Wed Oct 30 12:29:14 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Linus Walleij X-Patchwork-Id: 178114 Delivered-To: patch@linaro.org Received: by 2002:a92:409a:0:0:0:0:0 with SMTP id d26csp1207694ill; Wed, 30 Oct 2019 05:29:22 -0700 (PDT) X-Google-Smtp-Source: APXvYqzGdx8sQGO9KfXITtNjqzJ7L7fI4rVRgHOO7y+PUzdzW9D7nwkDk+EFVN1ELvlcyE1lv8Lv X-Received: by 2002:a17:906:f90c:: with SMTP id lc12mr8816453ejb.208.1572438561939; Wed, 30 Oct 2019 05:29:21 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1572438561; cv=none; d=google.com; s=arc-20160816; b=FH5vJcWzW+FVad/BlAGKyIq2KBffIPzoocgGBtbc5Ucmg5L+wCIfOqlokwYURvVh/1 j3YpX0tdv67wnOpBVXr0M3/Mh5Uh4O55fBwnjuaF2U7YaTAMRQhppQcjH1ToTJjysNk7 xpGqs2pHw3dVcaocQ/rZ9JWDQQO63G8HxT1YEhdUiT697AlLpzsmT2XJwLOI/uMEOlqA H0kphrdINdTZ7t4tEjajniD4gbWKT1BEv4lVu5gJaFLXv5RnCvrpuOhGQyYAqvBtfkUz sE8aFFevd081QTBay9o6PZ+KrdYJSg0KB3atHPJuG2rB7f2loxXTMcri+o+ZPDN7aksk n/wA== 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 :message-id:date:subject:cc:to:from:dkim-signature; bh=XWc+D4bAlNaYyFqWXP+pbdIeJckIAzrV3H2Lt8z7+Us=; b=H2KqzO0qzXdfPIvSTJF55gK/uCA4XFJD8PEiX6FgD4U1/o0DNYuV4D061+5yhBc6tv ZthJcCipO2msGkzqCii+pl6LH3zHnDN2mzX48HkmZa3xHMCx03AveNzQ8KWDjO2OYTXt m4MLH3/uqiQ/rYxRSMlEnZNdlyEwTFZK8juXyFgu+js4Rg2930RnQ7f55hHKjbwtEkn5 PtztPro9BxmSurCI6mW79oOgXeP1b8yLLKCsg1rPiEuYNvKkoDH9JBjWe30edZcu9F0q reb5Xe2haRX/Na5T17vtxKcq6Ed+XnTjsg8LXTiilfSoQlMUlWBEMdgWMvuC5ZPtgolF DkOA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=od9wq2om; 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=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 u6si1104809ejx.348.2019.10.30.05.29.21; Wed, 30 Oct 2019 05:29:21 -0700 (PDT) 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; dkim=pass header.i=@linaro.org header.s=google header.b=od9wq2om; 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=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726088AbfJ3M3V (ORCPT + 5 others); Wed, 30 Oct 2019 08:29:21 -0400 Received: from mail-lf1-f66.google.com ([209.85.167.66]:44512 "EHLO mail-lf1-f66.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726184AbfJ3M3U (ORCPT ); Wed, 30 Oct 2019 08:29:20 -0400 Received: by mail-lf1-f66.google.com with SMTP id v4so1386620lfd.11 for ; Wed, 30 Oct 2019 05:29:18 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=XWc+D4bAlNaYyFqWXP+pbdIeJckIAzrV3H2Lt8z7+Us=; b=od9wq2omSQU6wUPacuUEwaHujmzaW298xCoZp2G7uZVU3SGyXcbe7CMn7ySvUDIp3b +zFL2oNv2Lj1B/qWBMOvV29m2Z4YrBXpTG+5C5/7NgAr51wzfgd5CKsMe4OOia58N3Vq s0TaepUlLBgP5zkvInhxVOlRetpH6LS0Kmou73oeyBuZRKYMhVYfL22HzDrxkWkOT4nD qAXoA1tw8vos9cFW78DmXtX61PuMGmvnRX1ygK0GFmkYb7UG+KWjzevb7sA+MFwBSJ1J 1k1wSnR5m7d7qSzyaHJ1D7qucdkrtxvtEhG/7ACqAN7vQ2uDmDxvsRz1EBZiG/YX5PRH CyPA== 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:mime-version :content-transfer-encoding; bh=XWc+D4bAlNaYyFqWXP+pbdIeJckIAzrV3H2Lt8z7+Us=; b=VFPMpyj0D5fGtfyfi0WViVI5iWqMJCj9e4MbdpwPrNUisTZWjvzQzdVa+7aovnH292 Gva2uprR0KJetN3Cr3y5gUDXXH6QkUg6VoWePHASpbVamRW+ahKAIw9gVA3TiIzwbsym J9XTg7dKp8t2fdTqxMQdCtIallgEiHdzDFAKzWK4LLUK1GCpmrtXk+r7JTB73/bw84nM 3x1K1k3FPF2dFPTjiuKnGT6Ru5pTaN/c0prum3JrnLZdyqfnr6PBgCUOsfHYOltBhYXh 4qkqX8gnpezJIkwAQMhtZAA1rSOKMMSFw/pOc/7l9SJguzKEKgEdVfPT+A4iDkcYvRPY odlg== X-Gm-Message-State: APjAAAVI8hd1pDwevjOTTSJKDxR2wFqysDJuW0fzYOkdMMzT4AthhFYW hdOYm26u9IWptFLEejfwzb2JE2Eb1pv0jg== X-Received: by 2002:ac2:508b:: with SMTP id f11mr5333379lfm.116.1572438557038; Wed, 30 Oct 2019 05:29:17 -0700 (PDT) Received: from localhost.bredbandsbolaget (c-79c8225c.014-348-6c756e10.bbcust.telenor.se. [92.34.200.121]) by smtp.gmail.com with ESMTPSA id q15sm724673lfc.89.2019.10.30.05.29.15 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 30 Oct 2019 05:29:15 -0700 (PDT) From: Linus Walleij To: linux-gpio@vger.kernel.org Cc: Bartosz Golaszewski , Linus Walleij , Andy Shevchenko , Mika Westerberg , Hans de Goede Subject: [PATCH] gpiolib: Switch order of valid mask and hw init Date: Wed, 30 Oct 2019 13:29:14 +0100 Message-Id: <20191030122914.967-1-linus.walleij@linaro.org> X-Mailer: git-send-email 2.21.0 MIME-Version: 1.0 Sender: linux-gpio-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-gpio@vger.kernel.org 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. Cc: Andy Shevchenko Cc: Mika Westerberg Reported-by: Hans de Goede Signed-off-by: Linus Walleij --- Thinking of applying this for fixes to fix some part of the problems that Hans is seeing. --- drivers/gpio/gpiolib.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) -- 2.21.0 Acked-by: Hans de Goede Reviewed-by: Mika Westerberg Reviewed-by: Andy Shevchenko diff --git a/drivers/gpio/gpiolib.c b/drivers/gpio/gpiolib.c index 9afbc0612126..e865c889ba8d 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;