From patchwork Wed Oct 31 23:11:54 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sasha Levin X-Patchwork-Id: 149906 Delivered-To: patch@linaro.org Received: by 2002:a2e:299d:0:0:0:0:0 with SMTP id p29-v6csp102874ljp; Wed, 31 Oct 2018 16:12:21 -0700 (PDT) X-Google-Smtp-Source: AJdET5dRnIylLPLvErKpY+A1WX7gotLpXVG6cOAV0nYH4dCqISu71bYNz7WdhMexq/yg5fma+n9t X-Received: by 2002:a63:eb42:: with SMTP id b2-v6mr4917569pgk.348.1541027541671; Wed, 31 Oct 2018 16:12:21 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1541027541; cv=none; d=google.com; s=arc-20160816; b=I1EfD5B1lHoY3/BfeFykzbuQNMwxYi+Rdaro4yTmUnHSeRIURTQlSNRB9aYIAjtvSV H3RViHk4wPRD1jp6h64V8exwgWQv7U+BvkJ+ph0H1zQS9mMKVxPPVdYd7aivDE+t+Kcl moP+FsAdrSmQBQGDclNb8knq7cRACoZcd0ffmfirY3kg2Y6oQs8A50MpsLn0FLNTVtUC skH3WDSvMgdml6S+u98B/F18cgaP4je9L9T8C2KdbQ6fyQQVNXfE/HRBuvPTEjvzYV2p Lagzv130FxNKkYvN9GKkHrpqez/W1A5UT7KQSFIx6YgV5Q1HhrTRWy3VC5nIlBBVTsJY 0S7w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:references:in-reply-to:message-id:date :subject:cc:to:from:dkim-signature; bh=oeSxEEwcOtX+Trk5f94HyHx5hiYPPLEmZRgGFjJCCv4=; b=nrOhM5BEvUD1j8Yvlh39eNHYqMfBOsKDD6WAeZRgRwKNxYdH1X22svXfYAOY4dK61I xteLjmO3r13PqTALLVNBtOPrVrtd2bsmiC0t3hX9ITwWZMG/bj4REcWK3akvmk1GWgAI WolKDN1SBvgCr7C6OlGXusd4UvBPaec0l9tEqt3VD/Ir0fEoIfKOm14l6FS22LUi7Nmh +YLDFbWSsOgmeLEnI3bLNLFg1di10RAXarTgEYsPj/7aDNjCH/OlNsAQ5xrYU6WvoAwv nQY1DvHGoNbGorZPtEDNLcXdHZ1urbtqN4Hs3xR5Y2kz6GVu5ikK8xrvrTdm2PHJCJbZ hkoQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=nEoHFldt; 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=kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id e1-v6si29005529pgd.528.2018.10.31.16.12.21; Wed, 31 Oct 2018 16:12:21 -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=@kernel.org header.s=default header.b=nEoHFldt; 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=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1732316AbeKAIMa (ORCPT + 32 others); Thu, 1 Nov 2018 04:12:30 -0400 Received: from mail.kernel.org ([198.145.29.99]:37492 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1732263AbeKAIM3 (ORCPT ); Thu, 1 Nov 2018 04:12:29 -0400 Received: from sasha-vm.mshome.net (c-73-47-72-35.hsd1.nh.comcast.net [73.47.72.35]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 7969B2087A; Wed, 31 Oct 2018 23:12:16 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1541027537; bh=FEJ2OydZmOc8wVg1Xw19njW5epGCQDn+vAxsl019hRI=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=nEoHFldtMz3GoH8SwaasPHQce1swXzMep9EyxHZQq8xjCN1IQhV+UZakScPtMPz8B 5OILPDDhjrHvPuUf8AT0107wbt1FQkQDHTpxxd8AyXA8qnAyOEOGFPXQk5JmgLTBll FWZvuJrZxEsF7O0t3y2klCGRwaqNdtfmnL6UsUGM= From: Sasha Levin To: stable@vger.kernel.org, linux-kernel@vger.kernel.org Cc: Linus Walleij , Mark Brown , Sasha Levin Subject: [PATCH AUTOSEL 3.18 10/22] regulator: fixed: Default enable high on DT regulators Date: Wed, 31 Oct 2018 19:11:54 -0400 Message-Id: <20181031231206.29509-10-sashal@kernel.org> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20181031231206.29509-1-sashal@kernel.org> References: <20181031231206.29509-1-sashal@kernel.org> Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Linus Walleij [ Upstream commit 28be5f15df2ee6882b0a122693159c96a28203c7 ] commit efdfeb079cc3 ("regulator: fixed: Convert to use GPIO descriptor only") switched to use gpiod_get() to look up the regulator from the gpiolib core whether that is device tree or boardfile. This meant that we activate the code in a603a2b8d86e ("gpio: of: Add special quirk to parse regulator flags") which means the descriptors coming from the device tree already have the right inversion and open drain semantics set up from the gpiolib core. As the fixed regulator was inspected again we got the inverted inversion and things broke. Fix it by ignoring the config in the device tree for now: the later patches in the series will push all inversion handling over to the gpiolib core and set it up properly in the boardfiles for legacy devices, but I did not finish that for this kernel cycle. Fixes: commit efdfeb079cc3 ("regulator: fixed: Convert to use GPIO descriptor only") Reported-by: Leonard Crestez Reported-by: Fabio Estevam Reported-by: John Stultz Reported-by: Anders Roxell Signed-off-by: Linus Walleij Tested-by: John Stultz Signed-off-by: Mark Brown Signed-off-by: Sasha Levin --- drivers/regulator/fixed.c | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) -- 2.17.1 diff --git a/drivers/regulator/fixed.c b/drivers/regulator/fixed.c index 354105eff1f8..dfe2e91436e5 100644 --- a/drivers/regulator/fixed.c +++ b/drivers/regulator/fixed.c @@ -92,9 +92,14 @@ of_get_fixed_voltage_config(struct device *dev) of_property_read_u32(np, "startup-delay-us", &config->startup_delay); - config->enable_high = of_property_read_bool(np, "enable-active-high"); - config->gpio_is_open_drain = of_property_read_bool(np, - "gpio-open-drain"); + /* + * FIXME: we pulled active low/high and open drain handling into + * gpiolib so it will be handled there. Delete this in the second + * step when we also remove the custom inversion handling for all + * legacy boardfiles. + */ + config->enable_high = 1; + config->gpio_is_open_drain = 0; if (of_find_property(np, "vin-supply", NULL)) config->input_supply = "vin"; From patchwork Wed Oct 31 23:12:02 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sasha Levin X-Patchwork-Id: 149907 Delivered-To: patch@linaro.org Received: by 2002:a2e:299d:0:0:0:0:0 with SMTP id p29-v6csp102995ljp; Wed, 31 Oct 2018 16:12:29 -0700 (PDT) X-Google-Smtp-Source: AJdET5eeKEddz8yIkqCtRUwtzIttCBdca2gYCd/2GiD07WtAfoh3N0Jd+DUkKnHQBmkTDHF/+rVE X-Received: by 2002:a62:fd0b:: with SMTP id p11-v6mr5192659pfh.167.1541027549269; Wed, 31 Oct 2018 16:12:29 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1541027549; cv=none; d=google.com; s=arc-20160816; b=Rbg1wnqfnYQtlfdTIgL0+YxUmMbQj6JPOlDHWQi/74YWwUVgyF722YBJ4JcJ2m8R4n mhktSWZtHtEvGnJEiaY574FWtA9lWlvrLLxzdmOPiga8kzAy9QKPxkL82Q/iRyV1Nw7z hxqdXHNDjQVfQZL029fJy7QhvX4v9f5IwtDhLNWK5i2Rm4zReFL2KYuzhmbKFYw4yFUY sdZDu4BjlPQejG2q6ZQi2xDcZEUzcfodZkCW7lW8DyZkTIYONaBXh3VEYySPf3px7Tbs byP986odpzo/PC7tUjD6PQW+K6bqwF2VeE7f9vN4VAKlFaAuJDzX2jKJavGS6ZqhskWB GKew== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:references:in-reply-to:message-id:date :subject:cc:to:from:dkim-signature; bh=A1rTQmK1rP5vv4JYcvZrwuri1jehBXkusafKaa1smZI=; b=WkgKuEXxfGPNLIpS8ZiQfvEuNBQGeT8GCpZBdwwAeShh6gTgj+P5nFjj3C3hsg9czo u5rWANZHe+nl0qu75hwOYGDAuv7Yz0q1i2DinLckIsuqrltt0zXCYw0doBJ+AmDS/WKU kC6e2Qh0ftWew2NzYgrI/rxfcDAFm1sfsetpdySHfJ9z+x2PwCsUrsksL6cvU+7jmKCq HeNiaHk28jwWdosw+lgE0UGnaTdZ1nbdvrzw4J7zjdFoKWBUC5dYRYYmk3VYsmng7aG1 TxYdL8xr63XmjncQqkseX4S87kEGlHQp0dZ+HNDaQpkAAM5Qz+cZj8d+8EciW8MZP2Oh HKXA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=Kty9hMEq; 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=kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id 61-v6si29352161plf.345.2018.10.31.16.12.29; Wed, 31 Oct 2018 16:12:29 -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=@kernel.org header.s=default header.b=Kty9hMEq; 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=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1732389AbeKAIMj (ORCPT + 32 others); Thu, 1 Nov 2018 04:12:39 -0400 Received: from mail.kernel.org ([198.145.29.99]:37810 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1730474AbeKAIMg (ORCPT ); Thu, 1 Nov 2018 04:12:36 -0400 Received: from sasha-vm.mshome.net (c-73-47-72-35.hsd1.nh.comcast.net [73.47.72.35]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id DD07621104; Wed, 31 Oct 2018 23:12:23 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1541027544; bh=v47CDGbxOENzAMPOKoeJKAp11j0bzEXJHNMmoo5kuG8=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=Kty9hMEqSV7+gH1ejwXcf7g/1rfqOsAzcWOYgrrOsloNW9kIILbKHbbG5p5eetYIs JBtI7LBlPxU48D/cAxZtdKv4YJCQFuHppOQGWD7IIQvjCB4VSDcIWJJctWNTHE/weC SnV9QAV3KewAzEeqHAnjpDn48PpDlv+/LHYQ2bao= From: Sasha Levin To: stable@vger.kernel.org, linux-kernel@vger.kernel.org Cc: Loic Poulain , Peter Chen , Sasha Levin Subject: [PATCH AUTOSEL 3.18 18/22] usb: chipidea: Prevent unbalanced IRQ disable Date: Wed, 31 Oct 2018 19:12:02 -0400 Message-Id: <20181031231206.29509-18-sashal@kernel.org> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20181031231206.29509-1-sashal@kernel.org> References: <20181031231206.29509-1-sashal@kernel.org> Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Loic Poulain [ Upstream commit 8b97d73c4d72a2abf58f8e49062a7ee1e5f1334e ] The ChipIdea IRQ is disabled before scheduling the otg work and re-enabled on otg work completion. However if the job is already scheduled we have to undo the effect of disable_irq int order to balance the IRQ disable-depth value. Fixes: be6b0c1bd0be ("usb: chipidea: using one inline function to cover queue work operations") Signed-off-by: Loic Poulain Signed-off-by: Peter Chen Signed-off-by: Sasha Levin --- drivers/usb/chipidea/otg.h | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) -- 2.17.1 diff --git a/drivers/usb/chipidea/otg.h b/drivers/usb/chipidea/otg.h index 9ecb598e48f0..a5557c70034a 100644 --- a/drivers/usb/chipidea/otg.h +++ b/drivers/usb/chipidea/otg.h @@ -20,7 +20,8 @@ void ci_handle_vbus_change(struct ci_hdrc *ci); static inline void ci_otg_queue_work(struct ci_hdrc *ci) { disable_irq_nosync(ci->irq); - queue_work(ci->wq, &ci->work); + if (queue_work(ci->wq, &ci->work) == false) + enable_irq(ci->irq); } #endif /* __DRIVERS_USB_CHIPIDEA_OTG_H */