Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751257AbdH1XN6 (ORCPT ); Mon, 28 Aug 2017 19:13:58 -0400 Received: from smtp.codeaurora.org ([198.145.29.96]:44746 "EHLO smtp.codeaurora.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751189AbdH1XN4 (ORCPT ); Mon, 28 Aug 2017 19:13:56 -0400 DMARC-Filter: OpenDMARC Filter v1.3.2 smtp.codeaurora.org 39B1260723 Authentication-Results: pdx-caf-mail.web.codeaurora.org; dmarc=none (p=none dis=none) header.from=codeaurora.org Authentication-Results: pdx-caf-mail.web.codeaurora.org; spf=none smtp.mailfrom=sricharan@codeaurora.org Subject: Re: [PATCH v2 11/20] rpmsg: glink: Fix idr_lock from mutex to spinlock To: Chris Lew , ohad@wizery.com, bjorn.andersson@linaro.org, linux-remoteproc@vger.kernel.org, linux-kernel@vger.kernel.org, linux-arm-msm@vger.kernel.org, linux-arm-kernel@lists.infradead.org References: <1503559302-3744-1-git-send-email-sricharan@codeaurora.org> <1503559302-3744-12-git-send-email-sricharan@codeaurora.org> <88b34df6-d697-1d98-6427-5ddfe14785b1@codeaurora.org> From: Sricharan R Message-ID: Date: Tue, 29 Aug 2017 04:43:47 +0530 User-Agent: Mozilla/5.0 (Windows NT 10.0; WOW64; rv:52.0) Gecko/20100101 Thunderbird/52.3.0 MIME-Version: 1.0 In-Reply-To: <88b34df6-d697-1d98-6427-5ddfe14785b1@codeaurora.org> Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 8bit X-Antivirus: Avast (VPS 170828-4, 08/28/2017), Outbound message X-Antivirus-Status: Clean Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1491 Lines: 43 Hi Chris, On 8/29/2017 3:21 AM, Chris Lew wrote: > Hi Sricharan, > > Minor bug in this patch. > > On 8/24/2017 12:21 AM, Sricharan R wrote: > [..] >> @@ -829,11 +839,14 @@ static int qcom_glink_rx_open(struct qcom_glink *glink, unsigned int rcid, >>       struct device_node *node; >>       int lcid; >>       int ret; >> +    unsigned long flags; >>   +    spin_lock_irqsave(&glink->idr_lock, flags); >>       idr_for_each_entry(&glink->lcids, channel, lcid) { >>           if (!strcmp(channel->name, name)) >>               break; >>       } >> +    spin_unlock_irqrestore(&glink->idr_lock, flags); >>         if (!channel) { >>           channel = qcom_glink_alloc_channel(glink, name); >> @@ -844,15 +857,15 @@ static int qcom_glink_rx_open(struct qcom_glink *glink, unsigned int rcid, >>           create_device = true; >>       } >>   -    mutex_lock(&glink->idr_lock); >> +    spin_lock_irqsave(&glink->idr_lock, flags); >>       ret = idr_alloc(&glink->rcids, channel, rcid, rcid + 1, GFP_KERNEL); > > I think GFP_KERNEL should be changed to GFP_ATOMIC if the mutex is changed to spinlock. > ha, thanks for the catch. Regards, Sricharan -- "QUALCOMM INDIA, on behalf of Qualcomm Innovation Center, Inc. is a member of Code Aurora Forum, hosted by The Linux Foundation --- This email has been checked for viruses by Avast antivirus software. https://www.avast.com/antivirus