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=-15.5 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_PATCH, MAILING_LIST_MULTI,MENTIONS_GIT_HOSTING,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 1CAF6C41604 for ; Tue, 6 Oct 2020 05:07:31 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id B08B220870 for ; Tue, 6 Oct 2020 05:07:30 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1601960850; bh=2Lw05Nw7Nnhr3LxvA9LzlEGXYUIliAN66z8CjuaPzuc=; h=Subject:To:From:Date:List-ID:From; b=L6kC75Nbs8YpYIBDOJ9N7tDemRjWC1TXOU5X7/jYC4x3dc15Ct+j5F3NvQ5QPThdL Hn4rBjA/IwTROjKsJEwP2Ep6tw6QNuR/D4dzk7+pVal1tfE0gJ2tiAQ305Z01lDCRJ QzDuKptk8pJ3v8dM1LrCeyDYtUWyTKdY36NxYRbY= Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726713AbgJFFHa (ORCPT ); Tue, 6 Oct 2020 01:07:30 -0400 Received: from mail.kernel.org ([198.145.29.99]:46192 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726699AbgJFFHa (ORCPT ); Tue, 6 Oct 2020 01:07:30 -0400 Received: from localhost (83-86-74-64.cable.dynamic.v4.ziggo.nl [83.86.74.64]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 0EEB2208C3; Tue, 6 Oct 2020 05:07:28 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1601960849; bh=2Lw05Nw7Nnhr3LxvA9LzlEGXYUIliAN66z8CjuaPzuc=; h=Subject:To:From:Date:From; b=guXWUDuHxywjcaUMCRHBpHAJbYHDN/HS0tGOhZswZdjoDWSUSsxjG7FT0PRLVK/oS 9k8+WI7TTX2eeET7XWqTyWPWHvRomgbLjsQDje8Wc37tA57fKblwB15qmuLtCGRPE8 0le5H85wCt9kTNdRptsoYfA/rSSb50WLmNo31/uo= Subject: patch "extcon: ptn5150: Fix usage of atomic GPIO with sleeping GPIO chips" added to char-misc-next To: krzk@kernel.org, cw00.choi@samsung.com, stable@vger.kernel.org, vijaikumar.kanagarajan@gmail.com From: Date: Tue, 06 Oct 2020 07:07:15 +0200 Message-ID: <1601960835625@kroah.com> MIME-Version: 1.0 Content-Type: text/plain; charset=ANSI_X3.4-1968 Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: stable@vger.kernel.org This is a note to let you know that I've just added the patch titled extcon: ptn5150: Fix usage of atomic GPIO with sleeping GPIO chips to my char-misc git tree which can be found at git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/char-misc.git in the char-misc-next branch. The patch will show up in the next release of the linux-next tree (usually sometime within the next 24 hours during the week.) The patch will also be merged in the next major kernel release during the merge window. If you have any questions about this process, please let me know. >From 6aaad58c872db062f7ea2761421ca748bd0931cc Mon Sep 17 00:00:00 2001 From: Krzysztof Kozlowski Date: Mon, 17 Aug 2020 09:00:00 +0200 Subject: extcon: ptn5150: Fix usage of atomic GPIO with sleeping GPIO chips The driver uses atomic version of gpiod_set_value() without any real reason. It is called in a workqueue under mutex so it could sleep there. Changing it to "can_sleep" flavor allows to use the driver with all GPIO chips. Fixes: 4ed754de2d66 ("extcon: Add support for ptn5150 extcon driver") Cc: Signed-off-by: Krzysztof Kozlowski Reviewed-by: Vijai Kumar K Signed-off-by: Chanwoo Choi --- drivers/extcon/extcon-ptn5150.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/drivers/extcon/extcon-ptn5150.c b/drivers/extcon/extcon-ptn5150.c index d1c997599390..5f5252752644 100644 --- a/drivers/extcon/extcon-ptn5150.c +++ b/drivers/extcon/extcon-ptn5150.c @@ -127,7 +127,7 @@ static void ptn5150_irq_work(struct work_struct *work) case PTN5150_DFP_ATTACHED: extcon_set_state_sync(info->edev, EXTCON_USB_HOST, false); - gpiod_set_value(info->vbus_gpiod, 0); + gpiod_set_value_cansleep(info->vbus_gpiod, 0); extcon_set_state_sync(info->edev, EXTCON_USB, true); break; @@ -138,9 +138,9 @@ static void ptn5150_irq_work(struct work_struct *work) PTN5150_REG_CC_VBUS_DETECTION_MASK) >> PTN5150_REG_CC_VBUS_DETECTION_SHIFT); if (vbus) - gpiod_set_value(info->vbus_gpiod, 0); + gpiod_set_value_cansleep(info->vbus_gpiod, 0); else - gpiod_set_value(info->vbus_gpiod, 1); + gpiod_set_value_cansleep(info->vbus_gpiod, 1); extcon_set_state_sync(info->edev, EXTCON_USB_HOST, true); @@ -156,7 +156,7 @@ static void ptn5150_irq_work(struct work_struct *work) EXTCON_USB_HOST, false); extcon_set_state_sync(info->edev, EXTCON_USB, false); - gpiod_set_value(info->vbus_gpiod, 0); + gpiod_set_value_cansleep(info->vbus_gpiod, 0); } } -- 2.28.0