Received: by 2002:ab2:6816:0:b0:1f9:5764:f03e with SMTP id t22csp801029lqo; Fri, 17 May 2024 01:47:23 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCUvRChqL2t24JxfvOelx+DVfqjicJFQIdhBgm+b8hRoQ71qiu4DPIlE2sYYo4PJXMR9/FU+UobV+q131he4AW2wg6l+zHuVfWahpqTGgw== X-Google-Smtp-Source: AGHT+IGXa9ZbQFgSRs4EiAUOPNBKqo39ZC8dYMqfGIEkSKZPPpc8MvxOCNR/i/7a6OajNJyfm/PL X-Received: by 2002:a05:6a00:984:b0:6f3:e6c3:eadf with SMTP id d2e1a72fcca58-6f4df44ca45mr33187196b3a.15.1715935643514; Fri, 17 May 2024 01:47:23 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1715935643; cv=pass; d=google.com; s=arc-20160816; b=et73ECR7xs7XQOddwLNrWFCDrQGElu+8Ec11DVYN73IJ9hdivC2rTMq3KPltrKdqzE I95ogggeXaWZ6k6Cnz9KwIHVT4aTQkpSzqG2chuqsQfq+nUdE0EoSU97ADFSskhmg1jj FPg1O0Ubst0LK+e0BXmSXASOFShja37Ovfi8CXjNQ4R9RuPLQarBk1QU1ZnTt23++HAy gUcbVR69D0WjiiSIfL6LwAujizRnyL+e+a/B1lypZRH5SyMGmq84FJCbodeKtirL8rOL 7mqa5nr4seapfbEWjmRebSpVdjcOn58H0tQQrXHPyKgFW2xmfJ6bdcCUSme3TRQKw2ea EWSw== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:in-reply-to:references:cc:to:from :content-language:subject:user-agent:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:date:message-id:dkim-signature; bh=BNXEI5RgnF6KxXraKabW6jmWWMmCoWMSZc+WDDccCZU=; fh=khowzlkf4upir4OSkZCsITtxdQJw8PQ1SimkMRa7jWc=; b=LZAY4H3S+V3vA9R4a41ybCf+z6NglxbOaFyWtve7p/1jW5Wq4Z7bXkyAga9fw3sR/U akNI9Etc4mlcGCNbJl2dAQ4507Nbzmxr+zOtTaGFk/n2jdty5FI0U4stD2BiG4liinIT LZRPi8/Rl1ytd7+QDJnkLQTs7TLKhvphZTEz+ZoWXYWFaXA4VMnkYHYZlhk3qD1xUR// ow7FVFR9atMh+YVZFA/yvHOhdOAD72kT5B4Xqx6PhupRmdeQ47u/nEnN+HtpGDOP9wmT y3e8KZWWYkUFVS4UpwhwhCc2AnyGTns1jMivRTYPQo5uBJLdvQ/raN/Qr4JVzE/pVAKJ /w2Q==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=xeaiurc4; arc=pass (i=1 spf=pass spfdomain=linaro.org dkim=pass dkdomain=linaro.org dmarc=pass fromdomain=linaro.org); spf=pass (google.com: domain of linux-kernel+bounces-181876-linux.lists.archive=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) smtp.mailfrom="linux-kernel+bounces-181876-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from sv.mirrors.kernel.org (sv.mirrors.kernel.org. [139.178.88.99]) by mx.google.com with ESMTPS id d2e1a72fcca58-6f660539a90si9195727b3a.126.2024.05.17.01.47.23 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 17 May 2024 01:47:23 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-181876-linux.lists.archive=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) client-ip=139.178.88.99; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=xeaiurc4; arc=pass (i=1 spf=pass spfdomain=linaro.org dkim=pass dkdomain=linaro.org dmarc=pass fromdomain=linaro.org); spf=pass (google.com: domain of linux-kernel+bounces-181876-linux.lists.archive=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) smtp.mailfrom="linux-kernel+bounces-181876-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by sv.mirrors.kernel.org (Postfix) with ESMTPS id 21765283312 for ; Fri, 17 May 2024 08:47:22 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 0F1DDDF59; Fri, 17 May 2024 08:47:15 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=linaro.org header.i=@linaro.org header.b="xeaiurc4" Received: from mail-ed1-f53.google.com (mail-ed1-f53.google.com [209.85.208.53]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 976A21EB36 for ; Fri, 17 May 2024 08:47:12 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.208.53 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1715935634; cv=none; b=KSAxV8YQs/YwaYm5yMG7TpcNCqJXVS3csnNwmKML5d2H8MfJbugyQgI7UZSavfxWAQGVGFvpQDI8ZtC67tBmtLATpbyvW7VV3J9EVDJeWqDlp47m/uuikMIxFJSF24T46Cs7THJc9B52sVAK+Zn6kLPqkTQXCMSfNSbmJ5hDopw= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1715935634; c=relaxed/simple; bh=4OdmYv1WRNhO/gn86tq8/H6wXNfdPJ5uk/aGer4Pte8=; h=Message-ID:Date:MIME-Version:Subject:From:To:Cc:References: In-Reply-To:Content-Type; b=koA5bW7pSFFFZJOwJ8BvZlRKDl+sbnnc6ovlxYNU2zHEMmJAc2j6jV15aTM33msCvKmsIHYZkntf4oHksmgkc6lk4pYK00/ebeGOZyTCVLa3/JYBjAyiwr373RCmodFD9/89wYCnZt0CxoCk5b9WzLC0B7fQ+uw0jONaHow5AB0= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linaro.org; spf=pass smtp.mailfrom=linaro.org; dkim=pass (2048-bit key) header.d=linaro.org header.i=@linaro.org header.b=xeaiurc4; arc=none smtp.client-ip=209.85.208.53 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linaro.org Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=linaro.org Received: by mail-ed1-f53.google.com with SMTP id 4fb4d7f45d1cf-574b3d6c0f3so4563788a12.0 for ; Fri, 17 May 2024 01:47:12 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1715935631; x=1716540431; darn=vger.kernel.org; h=content-transfer-encoding:in-reply-to:references:cc:to:from :content-language:subject:user-agent:mime-version:date:message-id :from:to:cc:subject:date:message-id:reply-to; bh=BNXEI5RgnF6KxXraKabW6jmWWMmCoWMSZc+WDDccCZU=; b=xeaiurc4gxOUkPWGu6Poj2aEnyt1rEba1IKvACCEjDS3jZxIekz+E0KxJ57LbA8Sne bG9xhuBxB9Nx/OogkX6FwSRP7oZkamnEBkdtTK6zYoAHHvsFKax8QpHXB5fqUKYdP1yW gAV6SnAA8Zb8IYbURDSObhiaYeYsMB4Kp8p0vWlaqfIC5uylNkIJi2kCv6OMGngLyU+h 2yHiqH83OdVObPQUU3ZFrtVextzKP1XXO6mQBTrC3AYjlQWhRm+nY3cRdnGSOVqetF5F eZZmIPdYsuNC06t1vJfIcBwMhCJsbLJfFWZPPzxjjvyiNLasqkTh4xeFnLS24++7Mg3s 13Jg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1715935631; x=1716540431; h=content-transfer-encoding:in-reply-to:references:cc:to:from :content-language:subject:user-agent:mime-version:date:message-id :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=BNXEI5RgnF6KxXraKabW6jmWWMmCoWMSZc+WDDccCZU=; b=XynQUs6GkzquRnuvfx21E0acHQtvvOCpZYckY3TiqEh+/w0qqPhy90BzuHTvMyatkX QUcgjwz7jH9fkKpGzxKh6aH2stcZdrgObnXLLUt35P1BfcYDL7l+DtV7jpfNyWI+rtiu j8lH9pTx0hN6qljn6JG5SVKzhY+Qr9kh1Dd/pp7hQ0O3UQJVXV+3TwIVjdqpNMOvAG7v 8NB5vRzqyMpG20oHLoLQzKQkaF3yqVsOIQ60RJPLoQwjALCN3k3l3eR1xr51Yoqpz8Nl lvK4ARzMBBVWppNX8doCW0ZDFGweb3YqUqb6vpa8fOqYT9tQhFi7iLyqhuo3RkX8rP9k clGA== X-Forwarded-Encrypted: i=1; AJvYcCV94yIto5PIah8Q0aszgxW4I9sWuk8NbyL/xGziYFrez0TAKqs2zMFJv9ClH3Wrd8FdZ5sGrkTaxCV4vMaUavsaGVzipnLKdPYdZwhA X-Gm-Message-State: AOJu0YxGwPiFdKYf9rvkBQLj/CztEMjrBzRvdC4NiWwABRngLZRutpXT Do9UbKCEgj9nBMymAMV6WyJ9U1kdk3/Qqbojv++0anBzqEqd0juVKKZtqa/21/Y= X-Received: by 2002:a50:f60d:0:b0:571:fc6b:966c with SMTP id 4fb4d7f45d1cf-5734d5bec1amr13207770a12.13.1715935630962; Fri, 17 May 2024 01:47:10 -0700 (PDT) Received: from [10.91.1.133] ([149.14.240.163]) by smtp.gmail.com with ESMTPSA id 4fb4d7f45d1cf-574f26d1574sm4164356a12.36.2024.05.17.01.47.09 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Fri, 17 May 2024 01:47:10 -0700 (PDT) Message-ID: <5a19d2bd-340b-48f0-a64b-e5003b0064e3@linaro.org> Date: Fri, 17 May 2024 10:47:08 +0200 Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: [PATCH 3/7] hwspinlock: Introduce hwspin_lock_bust() Content-Language: en-US From: Bryan O'Donoghue To: Chris Lew , Bjorn Andersson , Baolin Wang , Peter Zijlstra , Ingo Molnar , Will Deacon , Waiman Long , Boqun Feng , Jonathan Corbet , Mathieu Poirier , Rob Herring , Krzysztof Kozlowski , Conor Dooley , Manivannan Sadhasivam , Konrad Dybcio Cc: linux-remoteproc@vger.kernel.org, linux-kernel@vger.kernel.org, linux-doc@vger.kernel.org, linux-arm-msm@vger.kernel.org, devicetree@vger.kernel.org, Richard Maina References: <20240516-hwspinlock-bust-v1-0-47a90a859238@quicinc.com> <20240516-hwspinlock-bust-v1-3-47a90a859238@quicinc.com> <77b01a97-de2d-4e10-91f6-915ec414eede@linaro.org> In-Reply-To: <77b01a97-de2d-4e10-91f6-915ec414eede@linaro.org> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit On 17/05/2024 10:07, Bryan O'Donoghue wrote: > On 17/05/2024 00:58, Chris Lew wrote: >> From: Richard Maina >> >> When a remoteproc crashes or goes down unexpectedly this can result in >> a state where locks held by the remoteproc will remain locked possibly >> resulting in deadlock. This new API hwspin_lock_bust() allows >> hwspinlock implementers to define a bust operation for freeing previously >> acquired hwspinlocks after verifying ownership of the acquired lock. >> >> Signed-off-by: Richard Maina >> Signed-off-by: Chris Lew >> --- >>   Documentation/locking/hwspinlock.rst     | 11 +++++++++++ >>   drivers/hwspinlock/hwspinlock_core.c     | 30 >> +++++++++++++++++++++++++++++- > > Shouldn't this be added to drivers/hwspinlock/qcom_hwspinlock.c ? > >>   drivers/hwspinlock/hwspinlock_internal.h |  3 +++ >>   include/linux/hwspinlock.h               |  6 ++++++ >>   4 files changed, 49 insertions(+), 1 deletion(-) >> >> diff --git a/Documentation/locking/hwspinlock.rst >> b/Documentation/locking/hwspinlock.rst >> index c1c2c827b575..6ee94cc6d3b7 100644 >> --- a/Documentation/locking/hwspinlock.rst >> +++ b/Documentation/locking/hwspinlock.rst >> @@ -85,6 +85,17 @@ is already free). >>   Should be called from a process context (might sleep). >> +:: >> + >> +  int hwspin_lock_bust(struct hwspinlock *hwlock, unsigned int id); > > I don't think this is a geat name "bust" looks alot like "burst" and I > don't think aligns well with the established namespace. > > Why not simply qcom_hwspinlock_unlock_force() - which is what you are > doing - forcing the hw spinlock to unlock. hmm looking again, I think _core is the right place and bust() is consistent with bust_spinlocks(); meh --- bod