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=-4.0 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI, SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED autolearn=no 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 D49B2C433E1 for ; Thu, 23 Jul 2020 19:37:31 +0000 (UTC) Received: from merlin.infradead.org (merlin.infradead.org [205.233.59.134]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 9D5882065F for ; Thu, 23 Jul 2020 19:37:31 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=lists.infradead.org header.i=@lists.infradead.org header.b="nySaBy2g"; dkim=fail reason="signature verification failed" (2048-bit key) header.d=linaro.org header.i=@linaro.org header.b="QTk2vg1w" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 9D5882065F Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=linaro.org Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=merlin.20170209; h=Sender:Content-Transfer-Encoding: Content-Type:Cc:List-Subscribe:List-Help:List-Post:List-Archive: List-Unsubscribe:List-Id:In-Reply-To:MIME-Version:References:Message-ID: Subject:To:From:Date:Reply-To:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Owner; bh=6JN7pVlu6yKxj8San8nPkDbo0ssfbbWUDg52PwRehCU=; b=nySaBy2gb+J2jRFeVcaYJdU1v SPyV86G13V4SVOHtbUnW/c/1HIH+/J4L4HZfaeDapGwVqGc+VXAnCQ78HHn03yBRbJE2mcB8ALI+Y 5Lv9TOZGLsQUP8eVrsw67SeVvo1OQUr7oINYbW/6bAeKYkUsOSxr5lMCSrnxgVEQ+EaYA9NPSr7cA TP3We2E8iJuAuFaMEQ9SmgOrD3j8UQl/rPjno2Z74mezk+vTgGMgwkeSYtQWXTwIPbNtfoDOpEgIj 6HAwqYsWBvvESSbWvV2tl50vDJUVZh2/vc4jcE5se2qNioeQpo1EerLwz5qtP0CxCYohtuSzf2d2u 5DJ3FdJlg==; Received: from localhost ([::1] helo=merlin.infradead.org) by merlin.infradead.org with esmtp (Exim 4.92.3 #3 (Red Hat Linux)) id 1jyh0j-0007Gi-IU; Thu, 23 Jul 2020 19:36:09 +0000 Received: from mail-pf1-x441.google.com ([2607:f8b0:4864:20::441]) by merlin.infradead.org with esmtps (Exim 4.92.3 #3 (Red Hat Linux)) id 1jyh0f-0007Ft-Tk for linux-arm-kernel@lists.infradead.org; Thu, 23 Jul 2020 19:36:07 +0000 Received: by mail-pf1-x441.google.com with SMTP id 207so3553996pfu.3 for ; Thu, 23 Jul 2020 12:36:05 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=date:from:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to; bh=z3ssCatcRW4rZnmRpDMOmwTthXZ+N/rbYAWFKA7lLY0=; b=QTk2vg1wW3NnuSyh9F/yMsuRxD/lZ0TmWkHYwg7J6W0H+oT7rMUvKxU2Tb0Qj9GSQC Dzxb/Svj2IBMg9DbZVuMYRm7lp5bTSrwMQCsC/MqJDJmy2d2x6/8ehLVwQiaHy1rXw0E yS9biyBhGiqRp+uFopNQQUq4sP3xk9w6S+gKzx+laCqNv0lxhhTWCXZ9ng1XAZBffRa0 PEqcSck9jwWhSG41+pScRL92UikRK8YAwIvAZyKc4tThwei6NoYsVNsUuxrXIlzZ+YwL Taay+1HQ4otHuFv/AiwhmeQfiZSw6m6qpfkD8ML7dxRYg9lEfMhtiEVxXZgQRJPtbNGd 4KSw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to; bh=z3ssCatcRW4rZnmRpDMOmwTthXZ+N/rbYAWFKA7lLY0=; b=U3Aj4/OcFIuSc7ebLEt92KTmwrs3sucYVLmltjR0mT2mC00nn73kQmtY+wHMi9pkeL 91/N0vo8mXZCtR8N4oKCd48i84KtxPLxE+DuDLnThV8W51VdGM7RzmqTiEOhALI5n601 b2+p8DTUDbdgWAcZFLEfOahzkKZVHsEdp926AWqv0H3CzRkV+CrMJuYreXKuus60Xztj +B3+zavoXq+Eb5qTn2ivELSmrwAbFQS2g9XidRan74tiZJl+aXxEBiOW0eiNHfI/Lm+5 n0bC3R56cGlTiMgxsQ2T7h9O9F5OqMRZQNkYsIociYn1dfbeNc82W9heDAsbBfVhfaQi XNlg== X-Gm-Message-State: AOAM531PqDHQwFPx0hMJ22IeGgfDGYqjK6vlX+XPegG2MC/A7jYWEpzm qVYnN52jaKevMPSeAvNjnboedw== X-Google-Smtp-Source: ABdhPJyXFDvPCMRTgXQfBhLcp+/bwuXSIxRGcmJv3r/1wiWk8yYBmCgQ9ycMEuKevREcrfe2Dh/ZKw== X-Received: by 2002:aa7:8e0c:: with SMTP id c12mr5476719pfr.38.1595532963696; Thu, 23 Jul 2020 12:36:03 -0700 (PDT) Received: from xps15 (S0106002369de4dac.cg.shawcable.net. [68.147.8.254]) by smtp.gmail.com with ESMTPSA id 82sm3582062pfz.151.2020.07.23.12.36.02 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 23 Jul 2020 12:36:03 -0700 (PDT) Date: Thu, 23 Jul 2020 13:36:01 -0600 From: Mathieu Poirier To: Suzuki K Poulose Subject: Re: [PATCH v3 19/20] coresight: add try_get_module() in coresight_grab_device() Message-ID: <20200723193601.GC1323936@xps15> References: <20200717054536.7052-1-tingwei@codeaurora.org> <20200717054536.7052-20-tingwei@codeaurora.org> <7ef8d427-23c9-10cd-b337-03ae75476a8c@arm.com> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: <7ef8d427-23c9-10cd-b337-03ae75476a8c@arm.com> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20200723_153606_199871_B0774AEF X-CRM114-Status: GOOD ( 15.73 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: tsoni@codeaurora.org, saiprakash.ranjan@codeaurora.org, kim.phillips@arm.com, jinlmao@codeaurora.org, alexander.shishkin@linux.intel.com, gregkh@linuxfoundation.org, coresight@lists.linaro.org, rdunlap@infradead.org, ykaukab@suse.de, linux@armlinux.org.uk, tingwei@codeaurora.org, leo.yan@linaro.org, linux-arm-kernel@lists.infradead.org Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org Hi Suzuki, On Wed, Jul 22, 2020 at 11:49:48AM +0100, Suzuki K Poulose wrote: > Hi Tingwei, > > On 07/17/2020 06:45 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. > > > > Is this really sufficient ? AFAIU, a device could be removed, but the > module may still be alive due to the refcount on the module. This If I understand correctly you are worried about cases where drivers would be removed but not the reference of the devices using those drivers in the coresight port connections? If so you are very right. Otherwise please expand on the scenario you have in mind. The first version of this set was doing all that cleanup... I haven't looked at this set yet but from what I've seen the cleanup code is not present in any of the sets after V1. Tingwei, is the work done in coresight_disable_match() part of the later revisions? > could imply that we have stale pointers in the _path_, which could > lead to corruption elsewhere. Should we do a get/put_device() instead ? > > Cheers > Suzuki _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel