Received: by 2002:ab2:644:0:b0:1ec:cbc4:63fb with SMTP id 4csp1151023lqn; Mon, 26 Feb 2024 09:04:46 -0800 (PST) X-Forwarded-Encrypted: i=3; AJvYcCVJENS44435+hrp3roCBTZGbTezAvTqq/oOWV3KG0b/uTSR4YyoR2VkCXSzG3qQdo3t5pAs4w9l29w+cm1f/L6CW01D/R0yDidCPrIirQ== X-Google-Smtp-Source: AGHT+IHntKu8kMb/Z8dUvSYV6i06tQoFoA3PqMHBF4YV/wEpacoOEc/xWCRrVqgK1RwR9Ba9VZRS X-Received: by 2002:a17:903:2286:b0:1d9:7ebe:431f with SMTP id b6-20020a170903228600b001d97ebe431fmr9303618plh.25.1708967086449; Mon, 26 Feb 2024 09:04:46 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1708967086; cv=pass; d=google.com; s=arc-20160816; b=U+X7CCB1Jn3m8G0V4saq+SKyJuO1n+jkz1wcUqM+u5a5LFxuwpYziaS6QX6RlG8W8c H7NcRYqgxgHqmjfgnE7L7tCrDpDjlKVX3L+YSb9uWZ483aBj6k9B8JnFMQDthy2XhRDV 7DdluSdwoKdtm+iU0QE3rFrGgEiCV1C5LwcPWhgM1fTJrIfGs+60ILePzYxzKSvaYoaT WAdJhyj9aQmz7VLXvi6Xi4MB/pdvp61yyfBq4YnHvIP94f0DNfbhdDgj8VfKazeV5H8x 3mLCVPLfcWGtbowhxnUarK6jcfOb/1OOKnLWi8TQI49IdSvV1lyQsffdDodLAMDN5wbX d37g== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:references:in-reply-to:message-id :date:subject:cc:to:from:dkim-signature; bh=YFVgmE6fC8McLNPQMyrQ9AZdJJ8T1N9YLZ9PrKcr1ZY=; fh=hD87NRI2uXFKH7lntJG4G4naYHSrGp3lxTKSbIyEdj8=; b=BFTBE5iRjimo6ooxOQK1E5VTv34IS0FxtyAEAd5q3Hbw0iVDc0Wz85A/aEUI7g/+M4 04Nu57JSzxz+B5GNCEljX79XSdsueUiYmUMVqMqR0dUff5JEnWLgpfGnwJbHA08Zu+If UfP0Vhv8fNvrGa5sdveS2+ktreqnBseDbx1VDxoc/qFVxkBG290e3Lc/Nv3uPotkLmoJ AwmAgPfzRvCPsEM0k8ph9Xdweyh/9fkcVmWje1q/8FlVoyowEjgZTqgXXYlG1aH/Owxs wcP7HsAHTLEWailimOmQV7/1cnl+LZTK2LHeJk6P418sKwvp3CHJPEFQloNLZnxddTH9 H5Mg==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@ibm.com header.s=pp1 header.b=oJ4T4a3v; arc=pass (i=1 spf=pass spfdomain=linux.ibm.com dkim=pass dkdomain=ibm.com dmarc=pass fromdomain=linux.ibm.com); spf=pass (google.com: domain of linux-kernel+bounces-81970-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-81970-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=REJECT sp=NONE dis=NONE) header.from=ibm.com Return-Path: Received: from sv.mirrors.kernel.org (sv.mirrors.kernel.org. [2604:1380:45e3:2400::1]) by mx.google.com with ESMTPS id u13-20020a170903124d00b001d4ca2fcc4asi3970855plh.291.2024.02.26.09.04.46 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 26 Feb 2024 09:04:46 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-81970-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=@ibm.com header.s=pp1 header.b=oJ4T4a3v; arc=pass (i=1 spf=pass spfdomain=linux.ibm.com dkim=pass dkdomain=ibm.com dmarc=pass fromdomain=linux.ibm.com); spf=pass (google.com: domain of linux-kernel+bounces-81970-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-81970-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=REJECT sp=NONE dis=NONE) header.from=ibm.com 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 14FC1286DB1 for ; Mon, 26 Feb 2024 17:00:18 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 520CF134CD0; Mon, 26 Feb 2024 16:53:58 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=ibm.com header.i=@ibm.com header.b="oJ4T4a3v" Received: from mx0b-001b2d01.pphosted.com (mx0b-001b2d01.pphosted.com [148.163.158.5]) (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 AB9F5133431; Mon, 26 Feb 2024 16:53:55 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=148.163.158.5 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1708966437; cv=none; b=FF/ZmkczEWZSZ45lpPLQR0uzIHPtATo+8YusrExrQdiUYpWe+jp80d95sagN0QWV+WnoO7rTsAfubUh5SYgNHifxZ4eKXAH/1SnyHMNO0+56cRfHWqg93JsgwGVQuZx2SDwg9ZWZjTK0CRMxgPBicCOyXl8NFwYoYQRYLwUTER8= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1708966437; c=relaxed/simple; bh=Nitj0lZrrDkxeMQ8i5VV2Bwzuo49UpxkAe+abtxsgAI=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: MIME-Version; b=CAAmYMivh7FG/chMJY3qV2ZLTQDfqbK89gFEgp+QKxWcVp3jenmF0IXJYgZbfs8zMbD5Tni13xi79790ZidZH/+VpRQxlwvdqflnB1HvJmrpZ1XuLmsGW8RoKM2KktTRKjfvaSVUonC0PCnVxUfGWLQI+Iv6Jxe1sBz+eFFg5Cs= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linux.ibm.com; spf=pass smtp.mailfrom=linux.ibm.com; dkim=pass (2048-bit key) header.d=ibm.com header.i=@ibm.com header.b=oJ4T4a3v; arc=none smtp.client-ip=148.163.158.5 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linux.ibm.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=linux.ibm.com Received: from pps.filterd (m0353722.ppops.net [127.0.0.1]) by mx0a-001b2d01.pphosted.com (8.17.1.19/8.17.1.19) with ESMTP id 41QGph80021815; Mon, 26 Feb 2024 16:53:43 GMT DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ibm.com; h=from : to : cc : subject : date : message-id : in-reply-to : references : mime-version : content-transfer-encoding; s=pp1; bh=YFVgmE6fC8McLNPQMyrQ9AZdJJ8T1N9YLZ9PrKcr1ZY=; b=oJ4T4a3v9xMoqBnSCMhKB6aak7W+Ona2rO3E+W6BTGgPa5dUMU0iaVtex3I/H8zJP5mo 9PN/+iKwY0gg0iAlWO8KalmLqZ4+ocvN1TeJLYmKx1BmB6gUnEwRuo1xu1wzn6vYCTqy wzwB898jrACA1Oh7tfUg8jI98K6ycYalQ3vheW2vkqggKYoNd3z5QCQEQ7nzxpkBvmt2 56Rt7cdq97TXgz8j7dKHAZMPhuOubqXMA4E7xFx+tBJV3YKq9EuWMKPyuUztc/oe3Vsw R7JTqbu4ic6OFAw3Ijp2U23qpbMk4ZeemQs9zvd29nyyso3FtuU0ERzTeSSZjtSZ74uP ZQ== Received: from ppma22.wdc07v.mail.ibm.com (5c.69.3da9.ip4.static.sl-reverse.com [169.61.105.92]) by mx0a-001b2d01.pphosted.com (PPS) with ESMTPS id 3wgvp6bkdb-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Mon, 26 Feb 2024 16:53:43 +0000 Received: from pps.filterd (ppma22.wdc07v.mail.ibm.com [127.0.0.1]) by ppma22.wdc07v.mail.ibm.com (8.17.1.19/8.17.1.19) with ESMTP id 41QGFrrB021762; Mon, 26 Feb 2024 16:53:42 GMT Received: from smtprelay06.dal12v.mail.ibm.com ([172.16.1.8]) by ppma22.wdc07v.mail.ibm.com (PPS) with ESMTPS id 3wfu5ytkrt-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Mon, 26 Feb 2024 16:53:42 +0000 Received: from smtpav05.wdc07v.mail.ibm.com (smtpav05.wdc07v.mail.ibm.com [10.39.53.232]) by smtprelay06.dal12v.mail.ibm.com (8.14.9/8.14.9/NCO v10.0) with ESMTP id 41QGrdIZ7209920 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Mon, 26 Feb 2024 16:53:42 GMT Received: from smtpav05.wdc07v.mail.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id B3E4358061; Mon, 26 Feb 2024 16:53:39 +0000 (GMT) Received: from smtpav05.wdc07v.mail.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 07B0458053; Mon, 26 Feb 2024 16:53:39 +0000 (GMT) Received: from slate16.aus.stglabs.ibm.com (unknown [9.61.57.130]) by smtpav05.wdc07v.mail.ibm.com (Postfix) with ESMTP; Mon, 26 Feb 2024 16:53:38 +0000 (GMT) From: Eddie James To: linux-fsi@lists.ozlabs.org Cc: linux-kernel@vger.kernel.org, linux-i2c@vger.kernel.org, devicetree@vger.kernel.org, andi.shyti@kernel.org, eajames@linux.ibm.com, alistair@popple.id.au, joel@jms.id.au, jk@ozlabs.org, robh@kernel.org, krzysztof.kozlowski+dt@linaro.org, conor+dt@kernel.org, lakshmiy@us.ibmcom Subject: [PATCH v2 21/31] fsi: aspeed: Use common master error handler Date: Mon, 26 Feb 2024 10:53:11 -0600 Message-Id: <20240226165321.91976-22-eajames@linux.ibm.com> X-Mailer: git-send-email 2.39.3 In-Reply-To: <20240226165321.91976-1-eajames@linux.ibm.com> References: <20240226165321.91976-1-eajames@linux.ibm.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-TM-AS-GCONF: 00 X-Proofpoint-ORIG-GUID: NALELMYsCZ3eQc4Sgz_1MA4rnSSIpAy7 X-Proofpoint-GUID: NALELMYsCZ3eQc4Sgz_1MA4rnSSIpAy7 X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.272,Aquarius:18.0.1011,Hydra:6.0.619,FMLib:17.11.176.26 definitions=2024-02-26_11,2024-02-26_01,2023-05-22_02 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 lowpriorityscore=0 mlxscore=0 clxscore=1015 adultscore=0 mlxlogscore=999 priorityscore=1501 spamscore=0 malwarescore=0 bulkscore=0 suspectscore=0 impostorscore=0 phishscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2311290000 definitions=main-2402260128 This will do the correct mmode manipulation to do the master reset. Signed-off-by: Eddie James --- drivers/fsi/fsi-master-aspeed.c | 27 ++++----------------------- 1 file changed, 4 insertions(+), 23 deletions(-) diff --git a/drivers/fsi/fsi-master-aspeed.c b/drivers/fsi/fsi-master-aspeed.c index 92b47bc9917a..ac8835e4d1f8 100644 --- a/drivers/fsi/fsi-master-aspeed.c +++ b/drivers/fsi/fsi-master-aspeed.c @@ -220,27 +220,6 @@ static int opb_readb(struct fsi_master_aspeed *aspeed, uint32_t addr, u8 *out) return __opb_read(aspeed, addr, XFER_BYTE, (void *)out); } -static int check_errors(struct fsi_master_aspeed *aspeed, int err) -{ - int ret; - - if (err == -EIO) { - /* Check MAEB (0x70) ? */ - - /* Then clear errors in master */ - ret = opb_writel(aspeed, ctrl_base + FSI_MRESP0, - cpu_to_be32(FSI_MRESP_RST_ALL_MASTER)); - if (ret) { - /* TODO: log? return different code? */ - return ret; - } - /* TODO: confirm that 0x70 was okay */ - } - - /* This will pass through timeout errors */ - return err; -} - static int aspeed_master_read(struct fsi_master *master, int link, uint8_t id, uint32_t addr, void *val, size_t size) { @@ -271,7 +250,8 @@ static int aspeed_master_read(struct fsi_master *master, int link, goto done; } - ret = check_errors(aspeed, ret); + if (ret == -EIO) + fsi_master_error(&aspeed->master, link); done: spin_unlock_irqrestore(&aspeed->lock, flags); return ret; @@ -307,7 +287,8 @@ static int aspeed_master_write(struct fsi_master *master, int link, goto done; } - ret = check_errors(aspeed, ret); + if (ret == -EIO) + fsi_master_error(&aspeed->master, link); done: spin_unlock_irqrestore(&aspeed->lock, flags); return ret; -- 2.39.3