From patchwork Tue Sep 17 17:16:46 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Eddie James X-Patchwork-Id: 1986471 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@legolas.ozlabs.org Authentication-Results: legolas.ozlabs.org; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=ibm.com header.i=@ibm.com header.a=rsa-sha256 header.s=pp1 header.b=Peye8FGv; dkim-atps=neutral Authentication-Results: legolas.ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=lists.ozlabs.org (client-ip=112.213.38.117; helo=lists.ozlabs.org; envelope-from=linux-fsi-bounces+incoming=patchwork.ozlabs.org@lists.ozlabs.org; receiver=patchwork.ozlabs.org) Received: from lists.ozlabs.org (lists.ozlabs.org [112.213.38.117]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (secp384r1)) (No client certificate requested) by legolas.ozlabs.org (Postfix) with ESMTPS id 4X7T3h4hv6z1y2g for ; Wed, 18 Sep 2024 03:17:04 +1000 (AEST) Received: from boromir.ozlabs.org (localhost [IPv6:::1]) by lists.ozlabs.org (Postfix) with ESMTP id 4X7T3h1lqXz2yZd for ; Wed, 18 Sep 2024 03:17:04 +1000 (AEST) X-Original-To: linux-fsi@lists.ozlabs.org Delivered-To: linux-fsi@lists.ozlabs.org Authentication-Results: lists.ozlabs.org; arc=none smtp.remote-ip=148.163.156.1 ARC-Seal: i=1; a=rsa-sha256; d=lists.ozlabs.org; s=201707; t=1726593420; cv=none; b=e/qOI/FRxHPh4h49lIBbQ0+SIQ/KjTyX4oUOzc9Ht4CVg2D5itvoftj0fUhFlCtbz4g4Fh95U6A4ae9HYiYuZ3yDQfwYOWuB01h/GGc3ucG2iiqJOzCNhK2H6+Gyfx8z7566CTH4FlRMPXn/cYyAAIyEM8X9ztTkX5xcH2NIwezixigvsUw+SvofQQrB+YPSe0Qpm61eo1eKhYIn5cf1QL79q6i7pPHfPJoo1N6tSrsXUKzuJKD8dWJQTRSDYg76MgOd7Q4hfxvpA5BVFJ6YRloHMVOb4aJN/fR/jMyoRLTsiL3O9F5fYLHAlgOd7A7dWu/ZgpurTgccM8C2lOSH7g== ARC-Message-Signature: i=1; a=rsa-sha256; d=lists.ozlabs.org; s=201707; t=1726593420; c=relaxed/relaxed; bh=1VCxXdruCaUDQBMQk8TopRbIOf+wHKRxlSwLZu4+S64=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=bykEZrU1KtQAwqakDhfP3oHuuKmu2J/QBFtvQ/wz1Nm7kDkxw51DDnbVVP/BBL3FceDoWFVPRrDBbrmOj4WAC8sjS0Zh2b0taqadG6mn3HNI4hOeBEo7VGaOEdXCm7bBrwU9+PxYusIlE7py9b15fa0SRqEes01SCREO+axVB3yAX+kW4+qQedBLN3rN7Bq0QkgkaBgTZBsvwCfyH9AZxVglJBp1jpub/NglVEN3j6SSRw4uJB9/Q5FsnsT+LWsEhU6sBx963jHtzGRePDR3lLSJ6THtyG0jz60vpEsuHqKin77bEKiz/VLT1Y0XwGvvKiJZZhrl2WA7IB7c+GCYqw== ARC-Authentication-Results: i=1; lists.ozlabs.org; dmarc=pass (p=none dis=none) header.from=linux.ibm.com; dkim=pass (2048-bit key; unprotected) header.d=ibm.com header.i=@ibm.com header.a=rsa-sha256 header.s=pp1 header.b=Peye8FGv; dkim-atps=neutral; spf=pass (client-ip=148.163.156.1; helo=mx0a-001b2d01.pphosted.com; envelope-from=eajames@linux.ibm.com; receiver=lists.ozlabs.org) smtp.mailfrom=linux.ibm.com Authentication-Results: lists.ozlabs.org; dmarc=pass (p=none dis=none) header.from=linux.ibm.com Authentication-Results: lists.ozlabs.org; dkim=pass (2048-bit key; unprotected) header.d=ibm.com header.i=@ibm.com header.a=rsa-sha256 header.s=pp1 header.b=Peye8FGv; dkim-atps=neutral Authentication-Results: lists.ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=linux.ibm.com (client-ip=148.163.156.1; helo=mx0a-001b2d01.pphosted.com; envelope-from=eajames@linux.ibm.com; receiver=lists.ozlabs.org) Received: from mx0a-001b2d01.pphosted.com (mx0a-001b2d01.pphosted.com [148.163.156.1]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by lists.ozlabs.org (Postfix) with ESMTPS id 4X7T3b4yRvz2yF7 for ; Wed, 18 Sep 2024 03:16:59 +1000 (AEST) Received: from pps.filterd (m0360083.ppops.net [127.0.0.1]) by mx0a-001b2d01.pphosted.com (8.18.1.2/8.18.1.2) with ESMTP id 48HA0XeR022514; Tue, 17 Sep 2024 17:16:53 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=1VCxXdruCaUDQ BMQk8TopRbIOf+wHKRxlSwLZu4+S64=; b=Peye8FGvA3ZnDJlizp0wO42+kX+ud tGwqf5nh696e9Zf0wlGxIQN665pa4DSpYAe0C3ziYjYEwGnjcgB6i5XpjbU1ef8l jNT/+DsyWJ+YdxPNxbs0Mq/H8H1mBxHhtc9RMzFmbWZhKgkwuAXWoJy4sgqRit/E HVmbyXoIAnOHAEYYWn2Amu7PcVFlI+XetLI2PwMyW2ivozcdDKvI3BEmRpeiwJiJ ZJEwBAgHxaBRdW89aSgniIIYwcmZ1yVUQNN2oq1JDV2Wc9Gr0RP7zRy8QBW3idgH +Bb6bNU/k4Fwsk5TjdkJWif/bhLBSJ7o4RA3lurLQEQ9oDXXLDi2uCBtQ== Received: from ppma21.wdc07v.mail.ibm.com (5b.69.3da9.ip4.static.sl-reverse.com [169.61.105.91]) by mx0a-001b2d01.pphosted.com (PPS) with ESMTPS id 41n3ud9hgp-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Tue, 17 Sep 2024 17:16:53 +0000 (GMT) Received: from pps.filterd (ppma21.wdc07v.mail.ibm.com [127.0.0.1]) by ppma21.wdc07v.mail.ibm.com (8.18.1.2/8.18.1.2) with ESMTP id 48HFvnsm000731; Tue, 17 Sep 2024 17:16:52 GMT Received: from smtprelay07.dal12v.mail.ibm.com ([172.16.1.9]) by ppma21.wdc07v.mail.ibm.com (PPS) with ESMTPS id 41nntq6eru-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Tue, 17 Sep 2024 17:16:52 +0000 Received: from smtpav01.dal12v.mail.ibm.com (smtpav01.dal12v.mail.ibm.com [10.241.53.100]) by smtprelay07.dal12v.mail.ibm.com (8.14.9/8.14.9/NCO v10.0) with ESMTP id 48HHGpcs42336750 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Tue, 17 Sep 2024 17:16:51 GMT Received: from smtpav01.dal12v.mail.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 0296C58058; Tue, 17 Sep 2024 17:16:51 +0000 (GMT) Received: from smtpav01.dal12v.mail.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id CAD7258062; Tue, 17 Sep 2024 17:16:50 +0000 (GMT) Received: from slate16.aus.stglabs.ibm.com (unknown [9.61.93.228]) by smtpav01.dal12v.mail.ibm.com (Postfix) with ESMTP; Tue, 17 Sep 2024 17:16:50 +0000 (GMT) From: Eddie James To: linux-fsi@lists.ozlabs.org Subject: [PATCH 14/15] fsi: sbefifo: Prevent async FFDC collection for Odyssey SBEFIFOs Date: Tue, 17 Sep 2024 12:16:46 -0500 Message-ID: <20240917171647.1403910-15-eajames@linux.ibm.com> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20240917171647.1403910-1-eajames@linux.ibm.com> References: <20240917171647.1403910-1-eajames@linux.ibm.com> MIME-Version: 1.0 X-TM-AS-GCONF: 00 X-Proofpoint-GUID: 1RVPjz0OFHe79Lb0cStWP9LKROMqZene X-Proofpoint-ORIG-GUID: 1RVPjz0OFHe79Lb0cStWP9LKROMqZene X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.293,Aquarius:18.0.1051,Hydra:6.0.680,FMLib:17.12.60.29 definitions=2024-09-17_08,2024-09-16_01,2024-09-02_01 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 clxscore=1015 bulkscore=0 phishscore=0 impostorscore=0 spamscore=0 priorityscore=1501 suspectscore=0 adultscore=0 mlxscore=0 lowpriorityscore=0 malwarescore=0 mlxlogscore=999 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.19.0-2408220000 definitions=main-2409170122 X-BeenThere: linux-fsi@lists.ozlabs.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: alistair@popple.id.au, linux-kernel@vger.kernel.org, ninad@linux.ibm.com, andrew@codeconstruct.com.au Errors-To: linux-fsi-bounces+incoming=patchwork.ozlabs.org@lists.ozlabs.org Sender: "linux-fsi" Newer SBEs will return any async FFDC in the next transaction, so collecting the FFDC is unnecessary and results in unexpected behavior. Turn off the async collection for newer SBEFIFOs. Signed-off-by: Eddie James --- drivers/fsi/fsi-sbefifo.c | 37 +++++++++++++++++++++++++++++++++++++ 1 file changed, 37 insertions(+) diff --git a/drivers/fsi/fsi-sbefifo.c b/drivers/fsi/fsi-sbefifo.c index 0385476bfb03..b8add20e05ec 100644 --- a/drivers/fsi/fsi-sbefifo.c +++ b/drivers/fsi/fsi-sbefifo.c @@ -125,6 +125,7 @@ struct sbefifo { struct mutex lock; bool broken; bool dead; + bool need_async; bool async_ffdc; bool timed_out; u32 timeout_in_cmd_ms; @@ -141,6 +142,10 @@ struct sbefifo_user { u32 read_timeout_ms; }; +struct sbefifo_data { + bool need_async; +}; + static DEFINE_MUTEX(sbefifo_ffdc_mutex); static ssize_t timeout_show(struct device *dev, struct device_attribute *attr, @@ -317,6 +322,10 @@ static int sbefifo_check_sbe_state(struct sbefifo *sbefifo) return -ESHUTDOWN; } + /* Newer SBEFIFOs don't need async FFDC collection */ + if (!sbefifo->need_async) + return 0; + /* Is there async FFDC available ? Remember it */ if (sbm & CFAM_SBM_SBE_ASYNC_FFDC) sbefifo->async_ffdc = true; @@ -1031,6 +1040,7 @@ static void sbefifo_free(struct device *dev) static int sbefifo_probe(struct device *dev) { + const struct sbefifo_data *md = of_device_get_match_data(dev); struct fsi_device *fsi_dev = to_fsi_dev(dev); struct sbefifo *sbefifo; struct device_node *np; @@ -1044,6 +1054,11 @@ static int sbefifo_probe(struct device *dev) if (!sbefifo) return -ENOMEM; + if (md) + sbefifo->need_async = md->need_async; + else + sbefifo->need_async = true; + /* Grab a reference to the device (parent of our cdev), we'll drop it later */ if (!get_device(dev)) { kfree(sbefifo); @@ -1128,6 +1143,27 @@ static int sbefifo_remove(struct device *dev) return 0; } +static const struct sbefifo_data p9_sbefifo_data = { + .need_async = true, +}; + +static const struct sbefifo_data odyssey_sbefifo_data = { + .need_async = false, +}; + +static const struct of_device_id sbefifo_of_ids[] = { + { + .compatible = "ibm,p9-sbefifo", + .data = &p9_sbefifo_data, + }, + { + .compatible = "ibm,odyssey-sbefifo", + .data = &odyssey_sbefifo_data, + }, + { } +}; +MODULE_DEVICE_TABLE(of, sbefifo_of_ids); + static const struct fsi_device_id sbefifo_ids[] = { { .engine_type = FSI_ENGID_SBE, @@ -1141,6 +1177,7 @@ static struct fsi_driver sbefifo_drv = { .drv = { .name = DEVICE_NAME, .bus = &fsi_bus_type, + .of_match_table = sbefifo_of_ids, .probe = sbefifo_probe, .remove = sbefifo_remove, }