Received: by 2002:a25:8b91:0:0:0:0:0 with SMTP id j17csp1288126ybl; Fri, 24 Jan 2020 20:11:45 -0800 (PST) X-Google-Smtp-Source: APXvYqxY1oZDSwH5FGAvejkuUWU1B2ikMw95dVwhKrbIUIa1Stm+m/MpsiJe0iS8HVqNr6Bda2yd X-Received: by 2002:a9d:3a66:: with SMTP id j93mr5328824otc.25.1579925505062; Fri, 24 Jan 2020 20:11:45 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1579925505; cv=none; d=google.com; s=arc-20160816; b=S8Km07c4PejAia7+67HlpBmE3s17IfFR2olm1eV7A/ijQaArLzSbzPSar4f/F8lD+l fLSFOTMJxPHMFQ5hBhsPScW88vC2t03xIYnP0GbExawqVQ/mTNsMG08H+MtIKF8ANIdy Q/8Ti12tqHIKva/lwvWVoja4e/MidDbSkYAEZyzFjKIyiwxgMaxqysHGOUAEx68rcMP+ 94qTBZV/0UkfDDUQaE1e5iDuyfaZ7aJEbmZUJ6o2ihfafTx1KeAx9vdygjw7pdrbLUq9 8a9bW8FI/JBdol8Tdl9exyVNGsLy2PwcAVrpSxYKGbYKqvnYTg0oyrI5zqfrTGo+jiYF JBuQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:dkim-signature; bh=EQnf/PSLd8HxryhRA93XP/hJ3+nOlFDpb2z4kyJm/Bo=; b=eDyHNukN3tttHy9fAhZtg2jMtjdLwFBghVUcaA+O0XGWClBmdSSSZ/8SastIpB9KkL dsfwiPoUVAdzt7dim6ucEANVGSQrfoAOCQ4XlSSbEWhWCtoDkL71EJ4PpMLJokp+D0og U0zrt4hjTYiguujrVs69YTIalsMXOpD9X/5zq9+Sg7qnw6+lVttwAGT13ucLOFiBTbfI lMGCgPuVOXuzHz0UJLVTRtNnxbt8ay2pTKbLmMsOyh/rIhBdN3ttkpEcyBD8/Dk/uEx7 QisiQ/kt5EsSQgrkzAYoAtLQJYBV+wJXE72R+yiwvrcpF0W64aCDE0R8uUSvm0BYCv9X 7nWA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=vK2YxIN1; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id d17si752743oij.136.2020.01.24.20.11.32; Fri, 24 Jan 2020 20:11:45 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=vK2YxIN1; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726454AbgAYEKj (ORCPT + 99 others); Fri, 24 Jan 2020 23:10:39 -0500 Received: from mail-qt1-f196.google.com ([209.85.160.196]:34616 "EHLO mail-qt1-f196.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725765AbgAYEKj (ORCPT ); Fri, 24 Jan 2020 23:10:39 -0500 Received: by mail-qt1-f196.google.com with SMTP id h12so3258444qtu.1; Fri, 24 Jan 2020 20:10:38 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=EQnf/PSLd8HxryhRA93XP/hJ3+nOlFDpb2z4kyJm/Bo=; b=vK2YxIN1kHaMHhJo21y06yzQNwoStGIU0tl/cCu7Fplp/Ugkhc0fuLkgIBy5qLvC++ 4UKFZBDNGUJ6mv3qsoNlP0gvoF+JwlaLS+WNpcJgMDYDYdCdj6MB6/6uMRWym87jZu58 cTxNXhkcwy8ZsIlJH5jwe1bdwUVieKBwYDAZQpl2A5oYRbYv0XLHk7rQkk2OHaLg8SuN kX+pyp9sc7aBpTmLx9bJcdtkZCq7OcqR7w7nXPX5kI38Rw+YjesLdhLYAoUiGzRatBPD lq2IqhYUAv5GNB2AWldQWB9daey4b/q2XFv5BWb6xTEVA+3WcI32xa3H+8AieBiXpw0L AEYw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=EQnf/PSLd8HxryhRA93XP/hJ3+nOlFDpb2z4kyJm/Bo=; b=I2KjkiaeCfj9uH0uZk1Zlpl1czMMYRfV/2vj7GX+UePPATaHSO1I7nl7LuTJ4OjqMh 7uSIP4k893OLMo7Eh7xo+1AoEconK/jgB3g+Ce8IfI7g+jDec3I0N9ijyA6+NWl7n6gJ rByILS1OAeMCNmqKT5I5UQP2vfZzXcjIg0MkxhnJoOMJbi1lTUpMmITMC6ZJRiyWrI6a rsfHE6x4KNmmYq/yhP+WDL4uNo9X8OPryG37nI8F34zv4Zep1F5sNpvh3x+vhK3tRkuE DL01FkDzzxyFkakxqrubGv/SuBPpqY4Uo3FqpHtN6yyjvtr6Cx/iGNSH2jgAd4D+auDz 5DFA== X-Gm-Message-State: APjAAAUtKPr34e/wvRjppZ8KsoK1QN0qAF3K7+OAVclVwos5VJ3IeTib rDg3gH1CYrisvM6o1OuAvVb74aVdlFUSYK62F4tS4g== X-Received: by 2002:ac8:7b24:: with SMTP id l4mr5942604qtu.3.1579925437832; Fri, 24 Jan 2020 20:10:37 -0800 (PST) MIME-Version: 1.0 References: <315adcc5dfc6aa5c001448401dda4065e33deef2.1578453062.git.baolin.wang7@gmail.com> <20200122001515.GA14744@builder> In-Reply-To: <20200122001515.GA14744@builder> From: Baolin Wang Date: Sat, 25 Jan 2020 12:10:26 +0800 Message-ID: Subject: Re: [PATCH RESEND 3/3] hwspinlock: omap: Use devm_hwspin_lock_register() to register hwlock controller To: Bjorn Andersson Cc: Ohad Ben Cohen , linux-omap@vger.kernel.org, linux-remoteproc@vger.kernel.org, LKML Content-Type: text/plain; charset="UTF-8" Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hi Bjorn, On Wed, Jan 22, 2020 at 8:15 AM Bjorn Andersson wrote: > > On Tue 07 Jan 19:14 PST 2020, Baolin Wang wrote: > > > Use devm_hwspin_lock_register() to register the hwlock controller instead of > > unregistering the hwlock controller explicitly when removing the device. > > > > Signed-off-by: Baolin Wang > > --- > > drivers/hwspinlock/omap_hwspinlock.c | 13 ++----------- > > 1 file changed, 2 insertions(+), 11 deletions(-) > > > > diff --git a/drivers/hwspinlock/omap_hwspinlock.c b/drivers/hwspinlock/omap_hwspinlock.c > > index 3b05560..9e8a8c2 100644 > > --- a/drivers/hwspinlock/omap_hwspinlock.c > > +++ b/drivers/hwspinlock/omap_hwspinlock.c > > @@ -131,8 +131,8 @@ static int omap_hwspinlock_probe(struct platform_device *pdev) > > for (i = 0, hwlock = &bank->lock[0]; i < num_locks; i++, hwlock++) > > hwlock->priv = io_base + LOCK_BASE_OFFSET + sizeof(u32) * i; > > > > - ret = hwspin_lock_register(bank, &pdev->dev, &omap_hwspinlock_ops, > > - base_id, num_locks); > > + ret = devm_hwspin_lock_register(&pdev->dev, bank, &omap_hwspinlock_ops, > > + base_id, num_locks); > > if (ret) > > goto runtime_err; > > > > @@ -148,15 +148,6 @@ static int omap_hwspinlock_probe(struct platform_device *pdev) > > > > static int omap_hwspinlock_remove(struct platform_device *pdev) > > { > > - struct hwspinlock_device *bank = platform_get_drvdata(pdev); > > - int ret; > > - > > - ret = hwspin_lock_unregister(bank); > > - if (ret) { > > - dev_err(&pdev->dev, "%s failed: %d\n", __func__, ret); > > - return ret; > > - } > > - > > Relying on devm_hwspin_lock_register() to hwspin_lock_unregister() will > mean that pm_runtime_disable() will now be called before the spinlocks > are unregistered. Yes, you are right. Thanks for catching this issue.