Received: by 2002:a05:6358:3188:b0:123:57c1:9b43 with SMTP id q8csp4531534rwd; Tue, 23 May 2023 08:54:13 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ7xG5mwn/YCIIIMkGlXS8BOToHVuEgqVztWwXL6FtVxlJOocIApuTSMuAlfkkqBq1Hdm1tG X-Received: by 2002:a17:902:ab42:b0:1ac:b363:83b3 with SMTP id ij2-20020a170902ab4200b001acb36383b3mr11118558plb.41.1684857253192; Tue, 23 May 2023 08:54:13 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1684857253; cv=none; d=google.com; s=arc-20160816; b=OdiSfd+bQJyjzsEcHpdce4dy03m4EJacsDPKIMl5Wzs/DKGmGAvckbkItfdNWu8k9c RzdvYvenQg9BEfFX0oZExKrfhx9cbhhBEM+/O+i3EpBMP6+YcCht8l9xtGbic8TumF3C 3UObvDloPNbJvPCqauEtMNOP0lMRfftSbQKOQrnreje+n+1ON2MZpuKO+CbZZlW9kBt1 ArYCwNzu6trsLu+0S+MiaSS0W1erPEpiemkzDhApIYTWHPUXDSnBXjneLzNtB6Y4b+Ff FrQ/iT5BA5P7FDj4tI0hKnjvElc3P66OMu33rb1B77IkNw7H69mystw4tM1C69IF6Fkc 8G4w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=QM/LRXENQW92kfDEhBKbagV6DNZu10tuXMpBW4Kha3Y=; b=afyd/pq8tg6fl4DEnlCPRL4qVg0o7oPou8T0xxQUWK03v30SG3EL5Qx5kwnC7EM9v0 cWlv90cgURBNEVGdliHNmsoahPikCikg5bamUdmF42ca0xvOZj3Oj5pG/iV137zXEnay 1gi9FdcjIyKKWROvDq70Z37PmG4LFk67wgp7KFQeOau8ieIMGFos/nFi4kXhbrN2wifY RDCfZOWvBJVj1uSq5BlslRRtL6uuSPVllQrCV2xbpcR93VKN+0eiSAbhUQmcTy3cFAem xlNcMyUT5GqaXW7GMW+I2C+n1rZEglhOF+oynSbksUPcd18QGrNiH/UFSMQOpZEzQ79f EQGg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=GpP3QlEO; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id jb1-20020a170903258100b001aaf7a9d7aasi4711416plb.126.2023.05.23.08.54.01; Tue, 23 May 2023 08:54:13 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=GpP3QlEO; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S237537AbjEWP0F (ORCPT + 99 others); Tue, 23 May 2023 11:26:05 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:35368 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S237474AbjEWP0A (ORCPT ); Tue, 23 May 2023 11:26:00 -0400 Received: from mail-wm1-x336.google.com (mail-wm1-x336.google.com [IPv6:2a00:1450:4864:20::336]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id A662B11A for ; Tue, 23 May 2023 08:25:58 -0700 (PDT) Received: by mail-wm1-x336.google.com with SMTP id 5b1f17b1804b1-3f60444238cso25906405e9.3 for ; Tue, 23 May 2023 08:25:58 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1684855558; x=1687447558; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=QM/LRXENQW92kfDEhBKbagV6DNZu10tuXMpBW4Kha3Y=; b=GpP3QlEO868ffEdiFshPBP0wC/K5EmhUiYR1UhNLFmT/1/sG8ZnkK7OBYZtsddw9j0 0HzPGOIE5uiQK3f7lqw48S81m4YQWD+WK2oy1X59AfI7VNpj7kUj1ZJVNP/Wy6U/NxFM GZybTQEpLBZabo/32Nhtig+QGiV4iSwQ1Aw73Ewjbf/uoCFjyecvLc0twnaw2lSdyN7B VasARwg1nz1DlYQqFM32k/Ibj9YZRvjy9pr6CNhiwbUFqk5F2zRcxeSq41saOz2A/OsQ NiC5YVsfp5+cS1U8L54rfMp5Ig4do80EaXx3x5mct6cadRpt+cEk7x2Pmy390LMgq8Nh JXSg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1684855558; x=1687447558; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=QM/LRXENQW92kfDEhBKbagV6DNZu10tuXMpBW4Kha3Y=; b=GkzbPX8GOxOEq/bLcp0hUbbLkupQCq59sdzNxfwe18A6TD3jaMGR60w3Y431keA+sC Bxx0K8J0uFznzQltdaAN2/2qWQGa6F44z4yuoFgak4WkohIGE1vmHqyYStLdnTKI3vBh JrGDxr2eXEG93RC5Z9776i262mzlNHakdqsgwuaSXAB5dVzt5iXs7Y6A1rpk9210l88L nakXytruaAFZYgN5YOge0MY5airSU1KHJeyG7kYddnGb7mX06nIu3VXp7Iqrzg9+oI7b 9CimnFjd9NmHVY+FrnBwujiNXeOflfGNhBeR97QM50nkP/olIP/eYYrB9toOBXqWiYGh 2hXA== X-Gm-Message-State: AC+VfDxHiddktgKlAhbbcgm+ueZ82WV0WyY38zZZiw2VVHMebnsN2E6n Htf5iZXBCGYCqEqCP/iKtI++7g== X-Received: by 2002:a1c:7311:0:b0:3f5:6e5:1689 with SMTP id d17-20020a1c7311000000b003f506e51689mr10865100wmb.17.1684855558235; Tue, 23 May 2023 08:25:58 -0700 (PDT) Received: from localhost.localdomain ([5.133.47.210]) by smtp.gmail.com with ESMTPSA id f20-20020a7bc8d4000000b003f6038faa19sm8303887wml.19.2023.05.23.08.25.57 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 23 May 2023 08:25:57 -0700 (PDT) From: Srinivas Kandagatla To: gregkh@linuxfoundation.org Cc: linux-kernel@vger.kernel.org, Richard Acayan , stable , Srinivas Kandagatla Subject: [PATCH 3/4] misc: fastrpc: return -EPIPE to invocations on device removal Date: Tue, 23 May 2023 16:25:49 +0100 Message-Id: <20230523152550.438363-4-srinivas.kandagatla@linaro.org> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20230523152550.438363-1-srinivas.kandagatla@linaro.org> References: <20230523152550.438363-1-srinivas.kandagatla@linaro.org> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=1.2 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_NONE, RCVD_IN_SBL_CSS,SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE, URIBL_BLOCKED autolearn=no autolearn_force=no version=3.4.6 X-Spam-Level: * X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Richard Acayan The return value is initialized as -1, or -EPERM. The completion of an invocation implies that the return value is set appropriately, but "Permission denied" does not accurately describe the outcome of the invocation. Set the invocation's return value to a more appropriate "Broken pipe", as the cleanup breaks the driver's connection with rpmsg. Fixes: c68cfb718c8f ("misc: fastrpc: Add support for context Invoke method") Cc: stable Signed-off-by: Richard Acayan Reviewed-by: Srinivas Kandagatla Signed-off-by: Srinivas Kandagatla --- drivers/misc/fastrpc.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/drivers/misc/fastrpc.c b/drivers/misc/fastrpc.c index a654dc416480..964f67dad2f9 100644 --- a/drivers/misc/fastrpc.c +++ b/drivers/misc/fastrpc.c @@ -2349,8 +2349,10 @@ static void fastrpc_notify_users(struct fastrpc_user *user) struct fastrpc_invoke_ctx *ctx; spin_lock(&user->lock); - list_for_each_entry(ctx, &user->pending, node) + list_for_each_entry(ctx, &user->pending, node) { + ctx->retval = -EPIPE; complete(&ctx->work); + } spin_unlock(&user->lock); } -- 2.25.1