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=-7.0 required=3.0 tests=DKIMWL_WL_HIGH,DKIM_SIGNED, DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_PATCH,MAILING_LIST_MULTI, SIGNED_OFF_BY,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 2E581C43381 for ; Fri, 8 Mar 2019 11:12:37 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id E994E20684 for ; Fri, 8 Mar 2019 11:12:36 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1552043557; bh=FeQVhuYG1zKb/LV/M5D+dh4omff4AZoZHl+W6bpJZOE=; h=Subject:To:Cc:From:Date:List-ID:From; b=xAnhdbkrKvFEE1WEbzmgwidYFrIsBPSBp0EY0xMPZbtoSCtMthl4fQFmX8O+63Cjo LD2lbmp4wXXwW5sZStzuceU3kVciY5iss9oxUeSFCUbXzNtMemZC+YMkKhlOv78fkF SCyiB9R186ma9sUtF4jfxPW7FcxXmsbpByxfDzKU= Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726042AbfCHLMg (ORCPT ); Fri, 8 Mar 2019 06:12:36 -0500 Received: from out2-smtp.messagingengine.com ([66.111.4.26]:46745 "EHLO out2-smtp.messagingengine.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725789AbfCHLMg (ORCPT ); Fri, 8 Mar 2019 06:12:36 -0500 Received: from compute6.internal (compute6.nyi.internal [10.202.2.46]) by mailout.nyi.internal (Postfix) with ESMTP id 39DFC21F8F; Fri, 8 Mar 2019 06:12:35 -0500 (EST) Received: from mailfrontend2 ([10.202.2.163]) by compute6.internal (MEProxy); Fri, 08 Mar 2019 06:12:35 -0500 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=fm2; bh=ZQue69 Ip4cI+1Jftut54iss2FM2EO7WhqiaDnMNFRRk=; b=K4FRnvMGY0p8uz7YxdDgNY QDfOnhp5viixlOfwuIyexRU045PpwuaalyBsczPePMHuqJ9QRU4DZoshAsHFZmQF KUGNRInkwQkEEVCQGmlSnqZlZXP+O0XOjd4bv9hze4HtU9WWiGJPMRI7mrp2U7Mj 1bfoe70vX1BFod3O5ZLUWKQLkizP7EmFgMP2ihrgPkAs7+DBXm/0O2yrR+u0k0NN yXxKfV/5f5dRuVOE9hzQnfhVC3DVM2FggLpDpDu2Vgkmk+FOMqRuwcZ5e30tRbfd ePK033JTo20o+FdHhDxBeepVzzesL9Y8InfyRV+Q2ZCywF8S6v7r75w/Qh/ItbWQ == X-ME-Sender: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedutddrgedtgddviecutefuodetggdotefrodftvf curfhrohhfihhlvgemucfhrghsthforghilhdpqfgfvfdpuffrtefokffrpgfnqfghnecu uegrihhlohhuthemuceftddtnecunecujfgurhepuffvhfffkfggtgfgsehtkeertddttd flnecuhfhrohhmpeeoghhrvghgkhhhsehlihhnuhigfhhouhhnuggrthhiohhnrdhorhhg qeenucfkphepkeefrdekiedrkeelrddutdejnecurfgrrhgrmhepmhgrihhlfhhrohhmpe hgrhgvgheskhhrohgrhhdrtghomhenucevlhhushhtvghrufhiiigvpedt X-ME-Proxy: Received: from localhost (5356596b.cm-6-7b.dynamic.ziggo.nl [83.86.89.107]) by mail.messagingengine.com (Postfix) with ESMTPA id EE34E100E5; Fri, 8 Mar 2019 06:12:33 -0500 (EST) Subject: FAILED: patch "[PATCH] USB: serial: cp210x: fix GPIO in autosuspend" failed to apply to 4.14-stable tree To: pados@pados.hu, johan@kernel.org, stable@vger.kernel.org Cc: From: Date: Fri, 08 Mar 2019 12:12:32 +0100 Message-ID: <155204355234169@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.14-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 7b0b644b9aa2de5032db0f468fddca091d0b7b90 Mon Sep 17 00:00:00 2001 From: Karoly Pados Date: Sun, 17 Feb 2019 18:59:01 +0100 Subject: [PATCH] USB: serial: cp210x: fix GPIO in autosuspend Current GPIO code in cp210x fails to take USB autosuspend into account, making it practically impossible to use GPIOs with autosuspend enabled without user configuration. Fix this like for ftdi_sio in a previous patch. Tested on a CP2102N. Signed-off-by: Karoly Pados Fixes: cf5276ce7867 ("USB: serial: cp210x: Adding GPIO support for CP2105") Cc: stable Signed-off-by: Johan Hovold diff --git a/drivers/usb/serial/cp210x.c b/drivers/usb/serial/cp210x.c index fac7a4547523..de076e866661 100644 --- a/drivers/usb/serial/cp210x.c +++ b/drivers/usb/serial/cp210x.c @@ -1370,8 +1370,13 @@ static int cp210x_gpio_get(struct gpio_chip *gc, unsigned int gpio) if (priv->partnum == CP210X_PARTNUM_CP2105) req_type = REQTYPE_INTERFACE_TO_HOST; + result = usb_autopm_get_interface(serial->interface); + if (result) + return result; + result = cp210x_read_vendor_block(serial, req_type, CP210X_READ_LATCH, &buf, sizeof(buf)); + usb_autopm_put_interface(serial->interface); if (result < 0) return result; @@ -1392,6 +1397,10 @@ static void cp210x_gpio_set(struct gpio_chip *gc, unsigned int gpio, int value) buf.mask = BIT(gpio); + result = usb_autopm_get_interface(serial->interface); + if (result) + goto out; + if (priv->partnum == CP210X_PARTNUM_CP2105) { result = cp210x_write_vendor_block(serial, REQTYPE_HOST_TO_INTERFACE, @@ -1409,6 +1418,8 @@ static void cp210x_gpio_set(struct gpio_chip *gc, unsigned int gpio, int value) NULL, 0, USB_CTRL_SET_TIMEOUT); } + usb_autopm_put_interface(serial->interface); +out: if (result < 0) { dev_err(&serial->interface->dev, "failed to set GPIO value: %d\n", result);