Message ID | 20221123175652.327859-2-conor@kernel.org |
---|---|
State | New |
Headers |
Return-Path: <linux-kernel-owner@vger.kernel.org> Delivered-To: ouuuleilei@gmail.com Received: by 2002:adf:f944:0:0:0:0:0 with SMTP id q4csp2940579wrr; Wed, 23 Nov 2022 10:03:06 -0800 (PST) X-Google-Smtp-Source: AA0mqf6sw7zucFrjTUbWc1dW4/2xdAdRpMOZv2d2VAOp+BzfJ5V6UnAQdVBm62oAtMhf43lqNvRG X-Received: by 2002:a05:6402:28ad:b0:469:2730:1c0f with SMTP id eg45-20020a05640228ad00b0046927301c0fmr13048003edb.215.1669226586003; Wed, 23 Nov 2022 10:03:06 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1669226585; cv=none; d=google.com; s=arc-20160816; b=gehq24sn8RwYslPkD4C6Ugv2KlEsr2QVUo7VbVOMq25B5KrYjzwDko9xF1oh8XwTs2 vyCkWVXFVjQ5t1gJ4OReCO9OZI4BRoSXnoa9syOU2ycnYY+7UZ3a7orWeKf3espwGwTi DTMruTLfNUMaoMFtrRksciaCphnGHD7TNp4I8mY+7GmbwrlnlTOSCOYhZUcU16aR7AV9 5a5joC1/EApKgXxulgw8XZuFTGYCLi/OdhbncIFooBeWFdsromd6qt2VjrtbTRT94VT8 kKMsoaax7pRc7UaPOcRSk0EE9Pjv/djbS7Jl7H9hwTJPxiXy19Z9JgRSc+lIjoTYq5Ru YBRA== 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=YTCYfeFIDfjaXYfyhuMzXOKcR3j9k0MucdfkVJjbSv4=; b=pD6Mlq99vGDKSXhAdazN3+Lndv3vsWRxeN1j0rvjvoCvVaextZwSLR0e9KxBEmbO+7 wTk4ns9qlyK74dU8hncBrILy6QGpMU3jkiYiDvajp71cgL6gMY78m4DXqX0mSUOWWB3z jyN/ms40w8H2+czRAXQGTZH0QZ5lmMRO3G4a/6FRG0Q+aDAg9JzyeqT7yjs3fHj2bn6n WEUU1tuZp5ms3WiDCVNeeO5WELPrdtW4JK5x6EFOXVrzjV4ziQr2egrjqrUjx9V5sKxF Lfhe59CPMA07EY7yr0R1nOY4hINOGlk63tProlGR+U4CYzRJs8vVIQWaQgt/Y2UxiY2H 5j7A== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=CSSGDzQi; 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=kernel.org Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id y15-20020a056402270f00b0045d4a88c735si15564920edd.220.2022.11.23.10.02.30; Wed, 23 Nov 2022 10:03:05 -0800 (PST) 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=@kernel.org header.s=k20201202 header.b=CSSGDzQi; 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=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S237556AbiKWR53 (ORCPT <rfc822;fengqi706@gmail.com> + 99 others); Wed, 23 Nov 2022 12:57:29 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:47784 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S239281AbiKWR5H (ORCPT <rfc822;linux-kernel@vger.kernel.org>); Wed, 23 Nov 2022 12:57:07 -0500 Received: from ams.source.kernel.org (ams.source.kernel.org [145.40.68.75]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id BC776C6629 for <linux-kernel@vger.kernel.org>; Wed, 23 Nov 2022 09:57:06 -0800 (PST) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ams.source.kernel.org (Postfix) with ESMTPS id 7B38EB81FE3 for <linux-kernel@vger.kernel.org>; Wed, 23 Nov 2022 17:57:05 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 0FE2DC433D7; Wed, 23 Nov 2022 17:57:02 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1669226224; bh=wxKRNQqmydSopaq3yHKk8toN/2zOQmC1pkaLy1+Ehkg=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=CSSGDzQiXa2ILS4WGGBSKvACOhV6QvQI9xRgiwSxlGfkV2yyeixoS4SdtPoL7s7bf 8TNDr2zLF14QRyI88mOpNJ6huU5kny68Y06DWco4M2iFrnoj6jpTfmdFybwo2nKNWE f2aotYGVayYV7QAkW/uHhH97x+fDPIzVGm9NDGyzV7+66P0TXPJ68+bshMVPVj5sc1 fd3SN6HOzG4ir2BQsfuMa2WrVKl7k/r8JBOYCJc4Jd+MPZcBeG3IDcoa6p/0DOJz6b Bcvf8za3qfB52rQWxtOumI6d4ykEtiT5MZMpfM54MBvrE1zTlrPw4N0SmpJmdMrOMd QjbBln1SVarEA== From: Conor Dooley <conor@kernel.org> To: Conor Dooley <conor.dooley@microchip.com>, Jassi Brar <jassisinghbrar@gmail.com> Cc: Daire McNamara <daire.mcnamara@microchip.com>, linux-riscv@lists.infradead.org, linux-kernel@vger.kernel.org Subject: [PATCH v3 1/2] soc: microchip: mpfs: handle failed system service requests Date: Wed, 23 Nov 2022 17:56:51 +0000 Message-Id: <20221123175652.327859-2-conor@kernel.org> X-Mailer: git-send-email 2.38.1 In-Reply-To: <20221123175652.327859-1-conor@kernel.org> References: <20221123175652.327859-1-conor@kernel.org> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-7.1 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_HI, SPF_HELO_NONE,SPF_PASS autolearn=ham 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: <linux-kernel.vger.kernel.org> X-Mailing-List: linux-kernel@vger.kernel.org X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1750310936268790596?= X-GMAIL-MSGID: =?utf-8?q?1750310936268790596?= |
Series |
mpfs: fix handling failed service requests
|
|
Commit Message
Conor Dooley
Nov. 23, 2022, 5:56 p.m. UTC
From: Conor Dooley <conor.dooley@microchip.com> If a service request fails, a non-zero, per-service error code will be set. Since the individual service drivers may wish to handle things differently, there's little point trying to do anything intelligent in the system controller driver. Let the caller know that things went wrong & leave the details of handling the error to it. Fixes: d0054a470c33 ("soc: add microchip polarfire soc system controller") Signed-off-by: Conor Dooley <conor.dooley@microchip.com> --- drivers/soc/microchip/mpfs-sys-controller.c | 6 ++++++ 1 file changed, 6 insertions(+)
Comments
On Wed, 23 Nov 2022 09:56:51 PST (-0800), Conor Dooley wrote: > From: Conor Dooley <conor.dooley@microchip.com> > > If a service request fails, a non-zero, per-service error code will be > set. Since the individual service drivers may wish to handle things > differently, there's little point trying to do anything intelligent in > the system controller driver. Let the caller know that things went wrong > & leave the details of handling the error to it. > > Fixes: d0054a470c33 ("soc: add microchip polarfire soc system controller") > Signed-off-by: Conor Dooley <conor.dooley@microchip.com> > --- > drivers/soc/microchip/mpfs-sys-controller.c | 6 ++++++ > 1 file changed, 6 insertions(+) > > diff --git a/drivers/soc/microchip/mpfs-sys-controller.c b/drivers/soc/microchip/mpfs-sys-controller.c > index 6e20207b5756..539fc24b397d 100644 > --- a/drivers/soc/microchip/mpfs-sys-controller.c > +++ b/drivers/soc/microchip/mpfs-sys-controller.c > @@ -52,6 +52,12 @@ int mpfs_blocking_transaction(struct mpfs_sys_controller *sys_controller, struct > > mutex_unlock(&transaction_lock); > > + if (ret) > + return ret; > + > + if (msg->response->resp_status) > + ret = -EIO; > + > return ret; > } > EXPORT_SYMBOL(mpfs_blocking_transaction); Reviewed-by: Palmer Dabbelt <palmer@rivosinc.com>
diff --git a/drivers/soc/microchip/mpfs-sys-controller.c b/drivers/soc/microchip/mpfs-sys-controller.c index 6e20207b5756..539fc24b397d 100644 --- a/drivers/soc/microchip/mpfs-sys-controller.c +++ b/drivers/soc/microchip/mpfs-sys-controller.c @@ -52,6 +52,12 @@ int mpfs_blocking_transaction(struct mpfs_sys_controller *sys_controller, struct mutex_unlock(&transaction_lock); + if (ret) + return ret; + + if (msg->response->resp_status) + ret = -EIO; + return ret; } EXPORT_SYMBOL(mpfs_blocking_transaction);