From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-6.8 required=3.0 tests=DKIMWL_WL_HIGH,DKIM_SIGNED, DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_PATCH,MAILING_LIST_MULTI, SIGNED_OFF_BY,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 4A3B7C0650F for ; Mon, 5 Aug 2019 05:02:02 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 200D42070D for ; Mon, 5 Aug 2019 05:02:02 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1564981322; bh=0Rk2tnyEDzLxUWyOBTMCa8/LRrLsnK12vtFPjlq0rdY=; h=Subject:To:Cc:From:Date:List-ID:From; b=shgs8tGSOgLGv60AfFKKC7Jtamx7iL5RkVtRCN9siqof84KpfFw3Q6AgQj+Sead3l uM+064QQOTApqOvLZSEAt0K3PiLIchjQp26ieuNL//Kh7+xqOWvBreEedBbchcvX+n t6kzab6MUF9AAMeL/Ko6UIaq2rUV6TET1I2dCq3g= Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726378AbfHEFCB (ORCPT ); Mon, 5 Aug 2019 01:02:01 -0400 Received: from out1-smtp.messagingengine.com ([66.111.4.25]:41663 "EHLO out1-smtp.messagingengine.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726375AbfHEFCB (ORCPT ); Mon, 5 Aug 2019 01:02:01 -0400 Received: from compute6.internal (compute6.nyi.internal [10.202.2.46]) by mailout.nyi.internal (Postfix) with ESMTP id 384E32026A; Mon, 5 Aug 2019 01:02:00 -0400 (EDT) Received: from mailfrontend2 ([10.202.2.163]) by compute6.internal (MEProxy); Mon, 05 Aug 2019 01:02:00 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:content-transfer-encoding:content-type :date:from:message-id:mime-version:subject:to:x-me-proxy :x-me-proxy:x-me-sender:x-me-sender:x-sasl-enc; s=fm3; bh=45IVzh 05alr1MDvMAiH3iAzPLFBwFVL3B3JGXwffKNY=; b=xdBNeiGytboeiK3aAdeHzn zA8l324jGJJOe5K1ZOxSpeWSnDrg3w3BcwYPoRsFkUkZ2a3zaGX+SoVJADSADjyx Pz6UsDnWsQ5n2KBYD+v0WDKA/hWMqZQzz9xHobGGd0nZe+P6kD9s7CFYHu0rotf9 ZL9E4Nq3MOqUtjA3GCrFhen5wAMDqf87oIgKq1yrsdEePYFw9EcllYZ0K0Yh76ff f9s4gVsJjNFOY6TKZ04JEpcBrmR+k6m7zSRIRwER3hNm8JxqkinrW+isGE0p6CQp FMqIo2hHHZpoxGqJQaK+/Iv0Y67DGoRKsVz2j8xyn+h9oUheM32y+hH1AZk1+c2Q == X-ME-Sender: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgeduvddruddtiedgkeefucetufdoteggodetrfdotf fvucfrrhhofhhilhgvmecuhfgrshhtofgrihhlpdfqfgfvpdfurfetoffkrfgpnffqhgen uceurghilhhouhhtmecufedttdenucenucfjughrpefuvffhfffkgggtgfesthekredttd dtlfenucfhrhhomhepoehgrhgvghhkhheslhhinhhugihfohhunhgurghtihhonhdrohhr gheqnecuffhomhgrihhnpehkvghrnhgvlhdrohhrghenucfkphepkeefrdekiedrkeelrd dutdejnecurfgrrhgrmhepmhgrihhlfhhrohhmpehgrhgvgheskhhrohgrhhdrtghomhen ucevlhhushhtvghrufhiiigvpedu X-ME-Proxy: Received: from localhost (83-86-89-107.cable.dynamic.v4.ziggo.nl [83.86.89.107]) by mail.messagingengine.com (Postfix) with ESMTPA id ABF84380085; Mon, 5 Aug 2019 01:01:59 -0400 (EDT) Subject: FAILED: patch "[PATCH] gpiolib: Preserve desc->flags when setting state" failed to apply to 4.19-stable tree To: chris.packham@alliedtelesis.co.nz, linus.walleij@linaro.org Cc: From: Date: Mon, 05 Aug 2019 07:01:50 +0200 Message-ID: <15649813101539@kroah.com> MIME-Version: 1.0 Content-Type: text/plain; charset=ANSI_X3.4-1968 Content-Transfer-Encoding: 8bit Sender: stable-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: stable@vger.kernel.org The patch below does not apply to the 4.19-stable tree. If someone wants it applied there, or to any other stable or longterm tree, then please email the backport, including the original git commit id to . thanks, greg k-h ------------------ original commit in Linus's tree ------------------ >From d95da993383c78f7efd25957ba3af23af4b1c613 Mon Sep 17 00:00:00 2001 From: Chris Packham Date: Mon, 8 Jul 2019 08:35:58 +1200 Subject: [PATCH] gpiolib: Preserve desc->flags when setting state desc->flags may already have values set by of_gpiochip_add() so make sure that this isn't undone when setting the initial direction. Cc: stable@vger.kernel.org Fixes: 3edfb7bd76bd1cba ("gpiolib: Show correct direction from the beginning") Signed-off-by: Chris Packham Link: https://lore.kernel.org/r/20190707203558.10993-1-chris.packham@alliedtelesis.co.nz Signed-off-by: Linus Walleij diff --git a/drivers/gpio/gpiolib.c b/drivers/gpio/gpiolib.c index bf05c29b53be..f497003f119c 100644 --- a/drivers/gpio/gpiolib.c +++ b/drivers/gpio/gpiolib.c @@ -1394,12 +1394,17 @@ int gpiochip_add_data_with_key(struct gpio_chip *chip, void *data, for (i = 0; i < chip->ngpio; i++) { struct gpio_desc *desc = &gdev->descs[i]; - if (chip->get_direction && gpiochip_line_is_valid(chip, i)) - desc->flags = !chip->get_direction(chip, i) ? - (1 << FLAG_IS_OUT) : 0; - else - desc->flags = !chip->direction_input ? - (1 << FLAG_IS_OUT) : 0; + if (chip->get_direction && gpiochip_line_is_valid(chip, i)) { + if (!chip->get_direction(chip, i)) + set_bit(FLAG_IS_OUT, &desc->flags); + else + clear_bit(FLAG_IS_OUT, &desc->flags); + } else { + if (!chip->direction_input) + set_bit(FLAG_IS_OUT, &desc->flags); + else + clear_bit(FLAG_IS_OUT, &desc->flags); + } } acpi_gpiochip_add(chip);