Skip to content

Commit 64ce7e9

Browse files
committed
Merge tag 'extcon-next-for-4.19' of git://git.kernel.org/pub/scm/linux/kernel/git/chanwoo/extcon into char-misc-next
Chanwoo writes: Update extcon for 4.19 Detailed description for this pull request: 1. Release locking when sending the connector state in extcon_sync() - Previously, extcon used the spinlock before calling the notifier_call_chain to prevent the scheduled out of task and to prevent the notification delay. When spinlock is locked for sending the notification, deadlock issue occured on the side of extcon consumer device. To fix this issue on extcon consumer device, release locking when sending the connector state. 2. Fix minor issues of extcon provider driver - extcon-intel-int3496.c uses 'linux/gpio/consumer.h' instead of 'linux/gpio.h' - extcon-usbc-cors-ec.c adds SPDX license and fix the wrong license information
2 parents 555e794 + 8a9dbb7 commit 64ce7e9

File tree

3 files changed

+9
-18
lines changed

3 files changed

+9
-18
lines changed

drivers/extcon/extcon-intel-int3496.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@
2020

2121
#include <linux/acpi.h>
2222
#include <linux/extcon-provider.h>
23-
#include <linux/gpio.h>
23+
#include <linux/gpio/consumer.h>
2424
#include <linux/interrupt.h>
2525
#include <linux/module.h>
2626
#include <linux/platform_device.h>

drivers/extcon/extcon-usbc-cros-ec.c

Lines changed: 6 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,8 @@
1-
/**
2-
* drivers/extcon/extcon-usbc-cros-ec - ChromeOS Embedded Controller extcon
3-
*
4-
* Copyright (C) 2017 Google, Inc
5-
* Author: Benson Leung <[email protected]>
6-
*
7-
* This software is licensed under the terms of the GNU General Public
8-
* License version 2, as published by the Free Software Foundation, and
9-
* may be copied, distributed, and modified under those terms.
10-
*
11-
* This program is distributed in the hope that it will be useful,
12-
* but WITHOUT ANY WARRANTY; without even the implied warranty of
13-
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14-
* GNU General Public License for more details.
15-
*/
1+
// SPDX-License-Identifier: GPL-2.0
2+
// ChromeOS Embedded Controller extcon
3+
//
4+
// Copyright (C) 2017 Google, Inc.
5+
// Author: Benson Leung <[email protected]>
166

177
#include <linux/extcon-provider.h>
188
#include <linux/kernel.h>
@@ -548,4 +538,4 @@ module_platform_driver(extcon_cros_ec_driver);
548538

549539
MODULE_DESCRIPTION("ChromeOS Embedded Controller extcon driver");
550540
MODULE_AUTHOR("Benson Leung <[email protected]>");
551-
MODULE_LICENSE("GPL");
541+
MODULE_LICENSE("GPL v2");

drivers/extcon/extcon.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -433,8 +433,8 @@ int extcon_sync(struct extcon_dev *edev, unsigned int id)
433433
return index;
434434

435435
spin_lock_irqsave(&edev->lock, flags);
436-
437436
state = !!(edev->state & BIT(index));
437+
spin_unlock_irqrestore(&edev->lock, flags);
438438

439439
/*
440440
* Call functions in a raw notifier chain for the specific one
@@ -448,6 +448,7 @@ int extcon_sync(struct extcon_dev *edev, unsigned int id)
448448
*/
449449
raw_notifier_call_chain(&edev->nh_all, state, edev);
450450

451+
spin_lock_irqsave(&edev->lock, flags);
451452
/* This could be in interrupt handler */
452453
prop_buf = (char *)get_zeroed_page(GFP_ATOMIC);
453454
if (!prop_buf) {

0 commit comments

Comments
 (0)