From nobody Fri Nov 29 18:47:07 2024 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 smtp.subspace.kernel.org (Postfix) with ESMTPS id 77A7C17C99B for ; Tue, 17 Sep 2024 17:17:02 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=148.163.156.1 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1726593424; cv=none; b=lYqLl4wyIAWGg72l8kM7Jp3lmzjBzEtV9t5Rf2rlyA7mYm17ZKoOUslZcOc21t6DF1JUAmPbhzm4gXWGqv+CoD1bICJdCanMDzmNk7+21KiblFT+20nBcufkwSF5quKjcyqWLUWWv7e9R6t3/iZjXbw4zS3NFF7pEJ/2OSORBl4= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1726593424; c=relaxed/simple; bh=B59B1hvMFhQ4pRxzqnm4r9AC0CPE1pZ7ayekXS9/wSU=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=mpqPkWgfGL4wfZREu6PBbGzfC9S6BWEseyOt8agYwQ0H8/TQvL8upJWHBWNNVSyFy5yYt5cGxnKwp8IeqLz531lEbMCysm7tzVXOzheAm5U7CBqnkMa6iWQ/Q3Pz6mCZJhwXsShsY73CwK2NSthVCmiB/jVK2dJ19CnWbDkh7r8= 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=Peye8FGv; arc=none smtp.client-ip=148.163.156.1 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 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=ibm.com header.i=@ibm.com header.b="Peye8FGv" 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 Cc: linux-kernel@vger.kernel.org, alistair@popple.id.au, joel@jms.id.au, jk@ozlabs.org, andrew@codeconstruct.com.au, eajames@linux.ibm.com, ninad@linux.ibm.com 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> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable 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 Content-Type: text/plain; charset="utf-8" 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; }; =20 +struct sbefifo_data { + bool need_async; +}; + static DEFINE_MUTEX(sbefifo_ffdc_mutex); =20 static ssize_t timeout_show(struct device *dev, struct device_attribute *a= ttr, @@ -317,6 +322,10 @@ static int sbefifo_check_sbe_state(struct sbefifo *sbe= fifo) return -ESHUTDOWN; } =20 + /* 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 =3D true; @@ -1031,6 +1040,7 @@ static void sbefifo_free(struct device *dev) =20 static int sbefifo_probe(struct device *dev) { + const struct sbefifo_data *md =3D of_device_get_match_data(dev); struct fsi_device *fsi_dev =3D 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; =20 + if (md) + sbefifo->need_async =3D md->need_async; + else + sbefifo->need_async =3D true; + /* Grab a reference to the device (parent of our cdev), we'll drop it lat= er */ if (!get_device(dev)) { kfree(sbefifo); @@ -1128,6 +1143,27 @@ static int sbefifo_remove(struct device *dev) return 0; } =20 +static const struct sbefifo_data p9_sbefifo_data =3D { + .need_async =3D true, +}; + +static const struct sbefifo_data odyssey_sbefifo_data =3D { + .need_async =3D false, +}; + +static const struct of_device_id sbefifo_of_ids[] =3D { + { + .compatible =3D "ibm,p9-sbefifo", + .data =3D &p9_sbefifo_data, + }, + { + .compatible =3D "ibm,odyssey-sbefifo", + .data =3D &odyssey_sbefifo_data, + }, + { } +}; +MODULE_DEVICE_TABLE(of, sbefifo_of_ids); + static const struct fsi_device_id sbefifo_ids[] =3D { { .engine_type =3D FSI_ENGID_SBE, @@ -1141,6 +1177,7 @@ static struct fsi_driver sbefifo_drv =3D { .drv =3D { .name =3D DEVICE_NAME, .bus =3D &fsi_bus_type, + .of_match_table =3D sbefifo_of_ids, .probe =3D sbefifo_probe, .remove =3D sbefifo_remove, } --=20 2.43.0