public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Chanwoo Choi <cw00.choi@samsung.com>
To: linux-kernel@vger.kernel.org
Cc: chanwoo@kernel.org, myungjoo.ham@samsung.com,
	stable@vger.kernel.org, Roger Quadros <rogerq@ti.com>,
	Kishon Vijay Abraham I <kishon@ti.com>,
	"H. Nikolaus Schaller" <hns@goldelico.com>
Subject: Re: [PATCH] extcon: Release locking when sending the notification of connector state
Date: Thu, 14 Jun 2018 19:18:52 +0900	[thread overview]
Message-ID: <5B22410C.9080002@samsung.com> (raw)
In-Reply-To: <1528949687-32002-1-git-send-email-cw00.choi@samsung.com>

+ H. Nikolaus Schaller <hns@goldelico.com>

On 2018년 06월 14일 13:14, Chanwoo Choi wrote:
> 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,
> extcon consumer device should always use the work. it is always not
> reasonable to use work.
> 
> To fix this issue on extcon consumer device, release locking when sending
> the notification of connector state.
> 
> Fixes: ab11af049f88 ("extcon: Add the synchronization extcon APIs to support the notification")
> Cc: stable@vger.kernel.org
> Cc: Roger Quadros <rogerq@ti.com>
> Cc: Kishon Vijay Abraham I <kishon@ti.com>
> Signed-off-by: Chanwoo Choi <cw00.choi@samsung.com>
> ---
>  drivers/extcon/extcon.c | 3 ++-
>  1 file changed, 2 insertions(+), 1 deletion(-)
> 
> diff --git a/drivers/extcon/extcon.c b/drivers/extcon/extcon.c
> index 8bff5fd18185..f75b08a45d4e 100644
> --- a/drivers/extcon/extcon.c
> +++ b/drivers/extcon/extcon.c
> @@ -433,8 +433,8 @@ int extcon_sync(struct extcon_dev *edev, unsigned int id)
>  		return index;
>  
>  	spin_lock_irqsave(&edev->lock, flags);
> -
>  	state = !!(edev->state & BIT(index));
> +	spin_unlock_irqrestore(&edev->lock, flags);
>  
>  	/*
>  	 * 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)
>  	 */
>  	raw_notifier_call_chain(&edev->nh_all, state, edev);
>  
> +	spin_lock_irqsave(&edev->lock, flags);
>  	/* This could be in interrupt handler */
>  	prop_buf = (char *)get_zeroed_page(GFP_ATOMIC);
>  	if (!prop_buf) {
> 


-- 
Best Regards,
Chanwoo Choi
Samsung Electronics

  reply	other threads:[~2018-06-14 10:19 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <CGME20180614041448epcas2p400dad902581dc6875461d4c3dd3a231d@epcas2p4.samsung.com>
2018-06-14  4:14 ` [PATCH] extcon: Release locking when sending the notification of connector state Chanwoo Choi
2018-06-14 10:18   ` Chanwoo Choi [this message]
2018-06-14 10:39     ` H. Nikolaus Schaller
2018-06-14 11:33       ` H. Nikolaus Schaller
2018-06-15  0:52         ` Chanwoo Choi
2018-06-17  0:31         ` Chanwoo Choi
2018-06-15  7:01   ` Roger Quadros

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=5B22410C.9080002@samsung.com \
    --to=cw00.choi@samsung.com \
    --cc=chanwoo@kernel.org \
    --cc=hns@goldelico.com \
    --cc=kishon@ti.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=myungjoo.ham@samsung.com \
    --cc=rogerq@ti.com \
    --cc=stable@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox