From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (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 C02BB346AC6; Tue, 17 Mar 2026 17:00:00 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1773766800; cv=none; b=InzW6F55FtZK/WjD56m8qPX9SrJd2kmbFjTWFiqD4zPzHHRPwL8iigZv1Ke39M6fKYsHteXGU03LXlYbRLAR3QmK5KUjR110q0Rjhr4HfX8xbaFlwsU2owZ/q5vXCMY5V+M9t2TNZA3OaMgmpiwxVhcm+WOjrpj/hhc3ZCadojQ= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1773766800; c=relaxed/simple; bh=Q3d2vRJ6apFr1LxNyj8J2DWFoeNR6qtF2aX5km+szPg=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=BDVEMbL7p+2VBm+QraYgNUjan7NHZkTTsk0tJXhUk8HWUx8QfQXJ31EJW1K7aeol9RJGS7qLvVXj0GsXess2W4uFM1iqcPcgvbWmZA5kKKxw+R8ZFN1iJPbja2/34qSGIrell0wLoESQDx/7kogseKXhCIhGW7J4j9Wv3fUk/ck= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b=GJEjI5XC; arc=none smtp.client-ip=10.30.226.201 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b="GJEjI5XC" Received: by smtp.kernel.org (Postfix) with ESMTPSA id 120F6C4CEF7; Tue, 17 Mar 2026 16:59:59 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1773766800; bh=Q3d2vRJ6apFr1LxNyj8J2DWFoeNR6qtF2aX5km+szPg=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=GJEjI5XCEORN7vL27KPrzaRbxuB2bV+TOoZAM93EE1GptchLmYZfKPQ6O7YyENmqD 2huylk1Hq4tPbS8vfa4ezx72Dekk6qkvud9QYZIL8mzX2QFM/cq5/1WUMVXs2Iqjev +mfoT79W8WGvE04KrvDmJtyyTGL9HuI8WUV+XHN4= From: Greg Kroah-Hartman To: stable@vger.kernel.org Cc: Greg Kroah-Hartman , patches@lists.linux.dev, Ingo Franzki , Harald Freudenberger , Vasily Gorbik Subject: [PATCH 6.19 324/378] s390/zcrypt: Enable AUTOSEL_DOM for CCA serialnr sysfs attribute Date: Tue, 17 Mar 2026 17:34:41 +0100 Message-ID: <20260317163018.910431872@linuxfoundation.org> X-Mailer: git-send-email 2.53.0 In-Reply-To: <20260317163006.959177102@linuxfoundation.org> References: <20260317163006.959177102@linuxfoundation.org> User-Agent: quilt/0.69 X-stable: review X-Patchwork-Hint: ignore Precedence: bulk X-Mailing-List: stable@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit 6.19-stable review patch. If anyone has any objections, please let me know. ------------------ From: Harald Freudenberger commit 598bbefa8032cc58b564a81d1ad68bd815c8dc0f upstream. The serialnr sysfs attribute for CCA cards when queried always used the default domain for sending the request down to the card. If for any reason exactly this default domain is disabled then the attribute code fails to retrieve the CCA info and the sysfs entry shows an empty string. Works as designed but the serial number is a card attribute and thus it does not matter which domain is used for the query. So if there are other domains on this card available, these could be used. So extend the code to use AUTOSEL_DOM for the domain value to address any online domain within the card for querying the cca info and thus show the serialnr as long as there is one domain usable regardless of the default domain setting. Fixes: 8f291ebf3270 ("s390/zcrypt: enable card/domain autoselect on ep11 cprbs") Suggested-by: Ingo Franzki Signed-off-by: Harald Freudenberger Reviewed-by: Ingo Franzki Cc: stable@vger.kernel.org Signed-off-by: Vasily Gorbik Signed-off-by: Greg Kroah-Hartman --- drivers/s390/crypto/zcrypt_ccamisc.c | 12 +++++++----- drivers/s390/crypto/zcrypt_cex4.c | 3 +-- 2 files changed, 8 insertions(+), 7 deletions(-) --- a/drivers/s390/crypto/zcrypt_ccamisc.c +++ b/drivers/s390/crypto/zcrypt_ccamisc.c @@ -1639,11 +1639,13 @@ int cca_get_info(u16 cardnr, u16 domain, memset(ci, 0, sizeof(*ci)); - /* get first info from zcrypt device driver about this apqn */ - rc = zcrypt_device_status_ext(cardnr, domain, &devstat); - if (rc) - return rc; - ci->hwtype = devstat.hwtype; + /* if specific domain given, fetch status and hw info for this apqn */ + if (domain != AUTOSEL_DOM) { + rc = zcrypt_device_status_ext(cardnr, domain, &devstat); + if (rc) + return rc; + ci->hwtype = devstat.hwtype; + } /* * Prep memory for rule array and var array use. --- a/drivers/s390/crypto/zcrypt_cex4.c +++ b/drivers/s390/crypto/zcrypt_cex4.c @@ -84,8 +84,7 @@ static ssize_t cca_serialnr_show(struct memset(&ci, 0, sizeof(ci)); - if (ap_domain_index >= 0) - cca_get_info(ac->id, ap_domain_index, &ci, 0); + cca_get_info(ac->id, AUTOSEL_DOM, &ci, 0); return sysfs_emit(buf, "%s\n", ci.serial); }