Received: by 2002:a05:6a10:22f:0:0:0:0 with SMTP id 15csp2853352pxk; Tue, 15 Sep 2020 04:13:49 -0700 (PDT) X-Google-Smtp-Source: ABdhPJykMwiKyOt8sQBTGUEKKgR8Gw0ZxYY3ae7jmJ/6jG7U+CI4ZCjENaz8GGFixVmG9CXuldD2 X-Received: by 2002:a50:e79c:: with SMTP id b28mr22321851edn.371.1600168429547; Tue, 15 Sep 2020 04:13:49 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1600168429; cv=none; d=google.com; s=arc-20160816; b=M/fSX6GiGOHHN8T1O6kYqD/BiaEvcuzGoBYlDsdKVscgD/W0kECSfgaBWwzQ3ORVXd OLIrLINyshq8xr90GmGfAL3jzIdAhgEMenaw5WAb5ptthg2TqUHZ7aBBgrFLQiiYCS56 9Oaljllm1C52k+Q/+lffRpsZIyCipPLndOPA9DZZLGc8P5XRtsIkkqrWH6UZiTKOtKKO V/BMHwFX249dBnJ6sXblDgYxNBAqhy4eGN7Py3kxsRiBf4ZLioQvRFKpzr8OYxkXraD+ Jb2HIoDx+B91PoHUPXhBD37JwLqHyvMcvZiDoRsOnSP+SOwfiWH5DWNrilJZahlfq5DZ SrBw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding :content-language:in-reply-to:mime-version:user-agent:date :message-id:from:references:cc:to:subject; bh=/diBBQbsSr2UucLlFgO3YoR09+oWbVLMz6PUerq+gaY=; b=o05PD1wtZGhh8xOa6UOkJlYSTZFEFKsF4RvqAR+mdL9Rd5D6GF7PxaA0XY2nnIGJss +1Hoc4hmoI0fdwaJx1IKwVcnVu4JihpjmeEaTOqEbv3x3qkNqgPX6mooQ8hEDiZrCKVf sb8OjQG9i0caQ9vzGm2L2E/NwAZpzPoihs4bqrXuxdt8semZhEokkHcIl5GsEHvgE4fN wvZPHR0tzrK7j5raL5JHC3HVfEWri8USTFRJXbaRRiFv8L7rfYichdLOs92xGYglAszq BA3YWL4zVkD3viXKmvL9tAujmWb/L3XFk5ksCREfrJJNczKZMal7uiIXe2XRVy9eR4Wc xszQ== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id f2si9234800edy.125.2020.09.15.04.13.26; Tue, 15 Sep 2020 04:13:49 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726156AbgIOLMW (ORCPT + 99 others); Tue, 15 Sep 2020 07:12:22 -0400 Received: from foss.arm.com ([217.140.110.172]:33064 "EHLO foss.arm.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726139AbgIOLKO (ORCPT ); Tue, 15 Sep 2020 07:10:14 -0400 Received: from usa-sjc-imap-foss1.foss.arm.com (unknown [10.121.207.14]) by usa-sjc-mx-foss1.foss.arm.com (Postfix) with ESMTP id 9C8BB1FB; Tue, 15 Sep 2020 04:03:28 -0700 (PDT) Received: from [10.57.48.219] (unknown [10.57.48.219]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPSA id B886B3F718; Tue, 15 Sep 2020 04:03:25 -0700 (PDT) Subject: Re: [PATCH v11 06/24] coresight: add try_get_module() in coresight_grab_device() To: tingwei@codeaurora.org, mathieu.poirier@linaro.org, alexander.shishkin@linux.intel.com, mike.leach@linaro.org Cc: gregkh@linuxfoundation.org, leo.yan@linaro.org, rdunlap@infradead.org, linux@armlinux.org.uk, kim.phillips@arm.com, ykaukab@suse.de, tsoni@codeaurora.org, saiprakash.ranjan@codeaurora.org, jinlmao@codeaurora.org, coresight@lists.linaro.org, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org References: <20200915104116.16789-1-tingwei@codeaurora.org> <20200915104116.16789-7-tingwei@codeaurora.org> From: Suzuki K Poulose Message-ID: <12e78abe-f5e0-0016-8984-f16aed77c755@arm.com> Date: Tue, 15 Sep 2020 12:08:08 +0100 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.7.0 MIME-Version: 1.0 In-Reply-To: <20200915104116.16789-7-tingwei@codeaurora.org> Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-US Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 09/15/2020 11:40 AM, Tingwei Zhang wrote: > When coresight device is in an active session, driver module of > that device should not be removed. Use try_get_module() in > coresight_grab_device() to prevent module to be unloaded. > Use get_device()/put_device() to protect device data > in the middle of active session. > > Signed-off-by: Tingwei Zhang > Tested-by: Mike Leach > Suggested-by: Suzuki K Poulose Reviewed-by: Suzuki K Poulose