Received: by 2002:a05:6358:11c7:b0:104:8066:f915 with SMTP id i7csp3431054rwl; Mon, 27 Mar 2023 14:04:27 -0700 (PDT) X-Google-Smtp-Source: AKy350ZijBeDQ4pXOW9LPXHYZlFbdtwWDh7zFvUg0EdSZTXPU2jVr9tf6YWQ1gpQ3wSXPERpcVXW X-Received: by 2002:a17:90b:3a91:b0:23d:4229:f7cf with SMTP id om17-20020a17090b3a9100b0023d4229f7cfmr14798947pjb.41.1679951067505; Mon, 27 Mar 2023 14:04:27 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1679951067; cv=none; d=google.com; s=arc-20160816; b=NZS0fzjH5uET2lOs5Cviwzwqpu/+8BpsOTJpsD5pQol/hHvq1I/SEkw29bPEfQkxMN zdZf1aEzHkGHOjh9t3DTalPnTsXxZh+Pnw93tdayLZ3wOA7rI+QGUZ+FkJmr5AACE1VN abCLM1cKgfej269WJgnc7OymuymlYIXZhoU/eXS4kFsswP5ZQVMGUc8TXdwTjRw21enC RFydNiAWGaM0IQRnjMbePN3gzmWVK/0M1a0zaJMh6H30IiNvvYaSrHEhszINPpcN0uwp ASZJdBXNxQTp0agl7DLYRByNl6JKAI54vZaVdCZqgm+/CAnKtOTFQBkpliNdRonlWWAT xTmg== 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=eco5b9MX5ijMYg1QKtG06cMKdPajE34qA3bf3aJ4dAA=; b=vFUt/AySvbHYRgwPkxcCW1YgVAih+I8va9qp8rBNKJpXvsRZGArWWYcy55UZiSWgj8 AN2n0VvSuWVKgeK6OBkYiWrPgxtNaX3NghW9z4ammcF0JmDy1QBw3I13gBzqtnyTb2yL 53eidy/OSFv0njoE36e3PmgkPZ9fsrQXcnIDc7TjWCAC6yLW0cARDIqshsZIKkjZhOas mm50UZEusq9hbbjzalt1dDSumGX5j7EVvcDgAfZr5EHUyWYiFEeFwKexjh0YBEeVqbB0 bMJH5YnWuYVYmDPOXEkCMPeg3l2ZjT4BJ6V3vQOyPE7O/fWsnGtRMis6FI8QEVso9FNG bB6w== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20210112 header.b=NyVHe8oA; 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=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id h9-20020a631209000000b00502e4278d61si27480799pgl.648.2023.03.27.14.04.15; Mon, 27 Mar 2023 14:04:27 -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=@gmail.com header.s=20210112 header.b=NyVHe8oA; 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=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231978AbjC0VDZ (ORCPT + 99 others); Mon, 27 Mar 2023 17:03:25 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:54024 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231892AbjC0VDV (ORCPT ); Mon, 27 Mar 2023 17:03:21 -0400 Received: from mail-yb1-xb32.google.com (mail-yb1-xb32.google.com [IPv6:2607:f8b0:4864:20::b32]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 140B71FE3; Mon, 27 Mar 2023 14:03:06 -0700 (PDT) Received: by mail-yb1-xb32.google.com with SMTP id z83so12484922ybb.2; Mon, 27 Mar 2023 14:03:06 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; t=1679950984; 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=eco5b9MX5ijMYg1QKtG06cMKdPajE34qA3bf3aJ4dAA=; b=NyVHe8oA3ZLVbwoWRx9rf6XjR5/Q1rU27zX+uDFgL4OG3dqLxUE9nK3EvijqfyMxOo McNY49CuX52JU+gIs73d4q5uGJPhxbCx/oR/xDySVE385rETNJLJRnXpjlOSh1nwGnCL z3uWLP+0qTmZJixvs+PVZLxedn4AfW2mFDpNECf/fKK3g6EEotFVKjbcH1pcZ7j7DdbT VNGdW/6Q7TlGqoPl36YfsKcAo2LqN50qkQ7/5RgaAas1vaKq5oIlM5DSWREHkla9Zo90 5SLxTeLkDqo6DuNGjC9wgB/818vq6pbINeLm7lXF0I28Ci18FZ94pKhZfhRGoby5M8fQ T8Xg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; t=1679950984; 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=eco5b9MX5ijMYg1QKtG06cMKdPajE34qA3bf3aJ4dAA=; b=ZJW+V2f61YD1Gk+ALXCoC3iLMu2ANzsINhaFjbcmL00W4roDvMCQzdhqA8Y+bZmf2w ikPvSa45PerIMz/Po/90N+wBvw8Ns7biSOuNmddoUlVX/7Vfj/Q9YQHA+yBkDY8geQzl Cm7APnsrxK21nlmPsYNIcJANocivpu+WIYBx0NVcYoxBEiFDTnzDL54DCio0iwzyLYda yWb9Fcf52ASbd47x9ewwy7Il+gGzK+37IjIio1ZqtG9sJW6S95/BEF39+jBjvCv9Ry6I dam9+KgzwaJctNaRVqzopm3SbLaLrQjiL4TKhJTQtllKMzaa4MGIW4JjqT1sh+n65L2X k85g== X-Gm-Message-State: AAQBX9caR9mLJ0zSrfoZEhlmCHN7Amh5OoiGbPVmPICfszcX85WSBmdg Iy9Pld1KPuY0BUqK4Vfk0XrUiOasNP0= X-Received: by 2002:a25:ada0:0:b0:af9:1ec5:4f10 with SMTP id z32-20020a25ada0000000b00af91ec54f10mr12668031ybi.59.1679950984547; Mon, 27 Mar 2023 14:03:04 -0700 (PDT) Received: from localhost ([2607:fea8:529d:4d00::9f37]) by smtp.gmail.com with ESMTPSA id b125-20020a256783000000b00b7767ca748dsm2525176ybc.42.2023.03.27.14.03.04 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 27 Mar 2023 14:03:04 -0700 (PDT) From: Richard Acayan To: Srinivas Kandagatla , Amol Maheshwari , Arnd Bergmann , Greg Kroah-Hartman , linux-arm-msm@vger.kernel.org, linux-kernel@vger.kernel.org Cc: Richard Acayan Subject: [PATCH v2 1/2] misc: fastrpc: return -EPIPE to invocations on device removal Date: Mon, 27 Mar 2023 17:02:17 -0400 Message-Id: <20230327210217.60948-2-mailingradian@gmail.com> X-Mailer: git-send-email 2.40.0 In-Reply-To: <20230327210217.60948-1-mailingradian@gmail.com> References: <20230327210217.60948-1-mailingradian@gmail.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-0.2 required=5.0 tests=DKIM_SIGNED,DKIM_VALID, DKIM_VALID_AU,DKIM_VALID_EF,FREEMAIL_FROM,RCVD_IN_DNSWL_NONE, SPF_HELO_NONE,SPF_PASS autolearn=unavailable autolearn_force=no version=3.4.6 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 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") Signed-off-by: Richard Acayan Reviewed-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 f48466960f1b..20c035af373a 100644 --- a/drivers/misc/fastrpc.c +++ b/drivers/misc/fastrpc.c @@ -2337,8 +2337,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.40.0