Received: by 2002:ab2:7855:0:b0:1f9:5764:f03e with SMTP id m21csp173431lqp; Wed, 22 May 2024 00:26:22 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCVbqWS9/jjvPbvZ2pcp9c8T33FjSLdgJyec4JSv3ACcE1FqdMkImZL+vd0jMtpcSHw7O82e+2uEx2ojEdkFioftKW7INHKK/TmNO8b51A== X-Google-Smtp-Source: AGHT+IEtLRqAB5dvSlUeC+UDzHEx0O4QLdosvlPNLwZYPKtNYDYv9PJbiBMdjqfUmq/1s7vHwK+i X-Received: by 2002:a05:6808:ecd:b0:3c9:c546:96d6 with SMTP id 5614622812f47-3cdbac88b56mr1429826b6e.37.1716362782246; Wed, 22 May 2024 00:26:22 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1716362782; cv=pass; d=google.com; s=arc-20160816; b=Xq83EIKCkgMDsaenAHMdcUpu/LAQPGkicJG59+wKQZIp2WDOeWTSBk6xkqaBVu2UfX jTcs9XiAxF7s9IFQT/ysUYEAi8Hwckn+QtxyW6e1jjwu73ka253KBKiowHLoau4CovGK Ud5NDAmgRxgRwTXkwWvp6xWgv/+2frbcJbo8uou44esDMnOccHt0rcwj65skCew2XYbd gQTY2HswKGDNoIyitHUAoIZjq0X+0/T42FS5mfeJHcIwzq5e5bsCcxMc6jlc4m8pv6kt STc6CT8ood5UrABYHIf0UM6tBvDqvOKjJuxQb5vu5/xDuI/9BT/p2bFETDZCjd1QgDNQ wD/Q== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:in-reply-to:autocrypt:content-language :from:references:cc:to:subject:user-agent:mime-version :list-unsubscribe:list-subscribe:list-id:precedence:date:message-id :dkim-signature; bh=0HcKCI7z9AgA4xNsED/dOM01aIzQPpqwY8rW5kOqJc0=; fh=1pmxUqZOrLC+ET/vbT4HX7o4aqZ3hyssPJAZ1N/L1J4=; b=tL7X8qPRra954m6MJAEsExYRGKsgqiPVRusEyJyYbhA48xnI1l4qxekaRSHQZpA0Cj h5433HSXvbsSWt2QCf8sHKVTRUH0B/c5Sdf62fCAMO3ynQVCaF6CpXWT5ZRGyaU7QqPS YoCUsuEh2yG+hnkef+fBaTRgz5drDT6ZdejdRilMRILpS19BiJdB6vVnLSUFndGA7hWb ldw79LacxSbJLmqZCQrsLfrV3ELkOZDYidnGGRXdrAibZkE9Cdd/d0mWEJK9C+fBtvG5 31j5PBbk/gDNU0vSrYJGn6xWZ1Odd9nNHXB+ycadySytqMEi/xPTt8+2TBW6mBXYmRlK VqMQ==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=EYH8z2PF; arc=pass (i=1 dkim=pass dkdomain=kernel.org); spf=pass (google.com: domain of linux-kernel+bounces-185853-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-185853-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from sv.mirrors.kernel.org (sv.mirrors.kernel.org. [2604:1380:45e3:2400::1]) by mx.google.com with ESMTPS id d2e1a72fcca58-6f4d2a7277asi1748778b3a.33.2024.05.22.00.26.21 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 22 May 2024 00:26:22 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-185853-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) client-ip=2604:1380:45e3:2400::1; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=EYH8z2PF; arc=pass (i=1 dkim=pass dkdomain=kernel.org); spf=pass (google.com: domain of linux-kernel+bounces-185853-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-185853-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.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 D2555282A47 for ; Wed, 22 May 2024 07:26:21 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id D84377D07F; Wed, 22 May 2024 07:26:10 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="EYH8z2PF" Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id D695E79B84; Wed, 22 May 2024 07:26:09 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1716362770; cv=none; b=i55GA/MUdktcWqQ3lauizYFT/qmR0zvo1gPtDYWXj/7bqlhBcLFTCfqJsTIEwiG9c193SFU1ZuLvSSL6fG7OaRzWEBSrpDKTZd9xv5iynrkoNRSxrc1eiQ09xQ/YjksCMm+w1vPq3JH0II5rRAtIHIuFbuaI88JWiovRg31CLGA= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1716362770; c=relaxed/simple; bh=n5LLv9bSswZF/D//73kPSDD+5Lxdyao4a0l3XWOscVY=; h=Message-ID:Date:MIME-Version:Subject:To:Cc:References:From: In-Reply-To:Content-Type; b=X0h39d1cp5bzdXVpoqOPe/ifQ+7eyZneSOWOoJgSkfDZ3Xv//edF3YkFk2cK3qsDzzpEi8jHLi1/qIQwNEflAIhOIHYre7iE0BPljTW6zxW2GQyfXRi1rluLze9aks2AM81oT0JVZ2s6TfMKCC6Rb2SGuQUTUrB76C1mBW+fYKM= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=EYH8z2PF; arc=none smtp.client-ip=10.30.226.201 Received: by smtp.kernel.org (Postfix) with ESMTPSA id 2329CC2BD11; Wed, 22 May 2024 07:26:02 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1716362769; bh=n5LLv9bSswZF/D//73kPSDD+5Lxdyao4a0l3XWOscVY=; h=Date:Subject:To:Cc:References:From:In-Reply-To:From; b=EYH8z2PFFr9Q6wEmLwnjgunv6W/i6KhHIoRRkdS0gDls0UL05iPDuFwOVg+sfncAU sm+fs0vxwUT3Xhn5WiFSstRChl46M0x0HMVFXfePC7jypxQaEWePW8ohdM+IojL2F9 AJmcUgzz8TQMu4E3AlGimv2ucFdwvsbSwDCPoAPqilLjM1dx7ZNEV2CN1N2ot09hfa g9dG7ZeIim117uTV+npXhquFOVda9kq/peI71W2RLJftsubnW+tiP7hXJDkJhiNFFP WVmUCrL1XSo8iHApZdziE+wUR2x0KMhPi0p3Sc0T8uXSi/Iy0BNrnbDLAuX8lTyyQD ZHTTM5Ryvgm1g== Message-ID: <92dcd555-69b1-4111-92dd-debe5107d526@kernel.org> Date: Wed, 22 May 2024 09:26:00 +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 5/7] dt-bindings: remoteproc: qcom,pas: Add hwlocks To: Bjorn Andersson Cc: 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 , 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 References: <20240516-hwspinlock-bust-v1-0-47a90a859238@quicinc.com> <20240516-hwspinlock-bust-v1-5-47a90a859238@quicinc.com> <3521519f-34b8-472d-be37-f0e64bba24fc@kernel.org> From: Krzysztof Kozlowski Content-Language: en-US Autocrypt: addr=krzk@kernel.org; keydata= xsFNBFVDQq4BEAC6KeLOfFsAvFMBsrCrJ2bCalhPv5+KQF2PS2+iwZI8BpRZoV+Bd5kWvN79 cFgcqTTuNHjAvxtUG8pQgGTHAObYs6xeYJtjUH0ZX6ndJ33FJYf5V3yXqqjcZ30FgHzJCFUu JMp7PSyMPzpUXfU12yfcRYVEMQrmplNZssmYhiTeVicuOOypWugZKVLGNm0IweVCaZ/DJDIH gNbpvVwjcKYrx85m9cBVEBUGaQP6AT7qlVCkrf50v8bofSIyVa2xmubbAwwFA1oxoOusjPIE J3iadrwpFvsZjF5uHAKS+7wHLoW9hVzOnLbX6ajk5Hf8Pb1m+VH/E8bPBNNYKkfTtypTDUCj NYcd27tjnXfG+SDs/EXNUAIRefCyvaRG7oRYF3Ec+2RgQDRnmmjCjoQNbFrJvJkFHlPeHaeS BosGY+XWKydnmsfY7SSnjAzLUGAFhLd/XDVpb1Een2XucPpKvt9ORF+48gy12FA5GduRLhQU vK4tU7ojoem/G23PcowM1CwPurC8sAVsQb9KmwTGh7rVz3ks3w/zfGBy3+WmLg++C2Wct6nM Pd8/6CBVjEWqD06/RjI2AnjIq5fSEH/BIfXXfC68nMp9BZoy3So4ZsbOlBmtAPvMYX6U8VwD TNeBxJu5Ex0Izf1NV9CzC3nNaFUYOY8KfN01X5SExAoVTr09ewARAQABzSVLcnp5c3p0b2Yg S296bG93c2tpIDxrcnprQGtlcm5lbC5vcmc+wsGVBBMBCgA/AhsDBgsJCAcDAgYVCAIJCgsE FgID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gcan8mCoqhJkbqrL7+nXG2 5Q/GS5M9RFWS+nYyJh+c3OcfKqVcZQNANItt7+ULzdNJuhvTRRdC3g9hmCEuNSr+CLMdnRBY fv0= In-Reply-To: Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit On 21/05/2024 21:17, Bjorn Andersson wrote: >>> >>> Hi Krzysztof, >>> >>> Sorry for the confusion, I dont think I meant that the smem driver will >>> ever crash. The referred to crash in the cover letter is a crash in the >>> firmware running on the remoteproc. The remoteproc could crash for any >>> unexpected reason, related or unrelated to smem, while holding the tcsr >>> mutex. I want to ensure that all resources that a remoteproc might be >>> using are released as part of remoteproc stop. >>> >>> The SMEM driver manages the lock/unlock operations on the tcsr mutex >>> from the Linux CPU's perspective. This case is for cleaning up from the >>> remote side's perspective. >>> >>> In this case it's the hwspinlock used to synchronize SMEM, but it's >>> conceivable that firmware running on the remoteproc has additional locks >>> that need to be busted in order for the system to continue executing >>> until the firmware is reinitialized. >>> >>> We did consider tying this to the SMEM instance, but the entitiy >>> relating to firmware is the remoteproc instance. >> >> I still do not understand why you have to add hwlock to remoteproc, even >> though it is not directly used. Your driver problem looks like lack of >> proper driver architecture - you want to control the locks not from the >> layer took the lock, but one layer up. Sorry, no, fix the driver >> architecture. >> > > No, it is the firmware's reference to the lock that is represented in > the remoteproc node, while SMEM deals with Linux's reference to the lock. > > This reference would be used to release the lock - on behalf of the > firmware - in the event that the firmware held it when it > stopped/crashed. I understood, but the remoteproc driver did not acquire the hardware lock. It was taken by smem, if I got it correctly, so you should poke smem to bust the spinlock. The hwlock is not a property of remote proc, because remote proc does not care, right? Other device cares... and now for every smem user you will add new binding property? No, you are adding a binding based on your driver solution. Best regards, Krzysztof