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 610B2235C01; Mon, 23 Mar 2026 14:45:19 +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=1774277119; cv=none; b=o1SEpY2mr+xpdPdnoSu05TJrhe6FM9PtBOmK42GWY1tCT0p5NweAfpHPU+kHHml245e7JcLf8E6UOL41PL3VIJKw0cnhxaRzMAbp6WDHJ4GAbxUO/IdJdx7FyIzeD/okLdrCFnoDYza88enuvQMSWjVdBeuslYMMBPnluZiMI2E= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1774277119; c=relaxed/simple; bh=kxinHW94fhLfhO3jBDw8TB6E1oMfkGGRkpmurwkMHTA=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=SauHEmCz8AUsXHASKv1920y5Qo8RjGHxlXORWlwQVIagVOPvU3P7Jfzi6JQPp77yWR98ZI+5BzHbgCsUP8HF/zpWSsjAYqNIDxb5dj1WETD9Wl/BV7dKPa9nTbNTjDaAAnf8reieM4vQg80f71qlIt+TRPIL/5oW3MXJ+N3Wnb8= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b=N2yYNWU5; 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="N2yYNWU5" Received: by smtp.kernel.org (Postfix) with ESMTPSA id C8ECDC4CEF7; Mon, 23 Mar 2026 14:45:18 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1774277119; bh=kxinHW94fhLfhO3jBDw8TB6E1oMfkGGRkpmurwkMHTA=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=N2yYNWU5g7jIkXGkECEnFNLY8xWquG7Dvv5FZ+yLxb/tpgyhBjEoDkGsUXC1peiJW 4x9BN6/A4ctJyL8D2SUtbNx9+sYkZHej3WiYPW9CWfY7kMupvkez9vM9lnaHhox3SK x8EBKL6b3t9MirtRCOZyKHR9KLD/lrhmfh55HaBA= From: Greg Kroah-Hartman To: stable@vger.kernel.org Cc: Greg Kroah-Hartman , patches@lists.linux.dev, Ingo Franzki , Harald Freudenberger , Vasily Gorbik , Sasha Levin Subject: [PATCH 6.12 325/460] s390/zcrypt: Enable AUTOSEL_DOM for CCA serialnr sysfs attribute Date: Mon, 23 Mar 2026 14:45:21 +0100 Message-ID: <20260323134534.495781286@linuxfoundation.org> X-Mailer: git-send-email 2.53.0 In-Reply-To: <20260323134526.647552166@linuxfoundation.org> References: <20260323134526.647552166@linuxfoundation.org> User-Agent: quilt/0.69 X-stable: review X-Patchwork-Hint: ignore Precedence: bulk X-Mailing-List: patches@lists.linux.dev List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit 6.12-stable review patch. If anyone has any objections, please let me know. ------------------ From: Harald Freudenberger [ Upstream commit 598bbefa8032cc58b564a81d1ad68bd815c8dc0f ] 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 [ preserved zc->online as the fourth argument to cca_get_info() ] Signed-off-by: Sasha Levin 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 @@ -1665,11 +1665,13 @@ static int fetch_cca_info(u16 cardnr, u1 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 page for rule array and var array use */ pg = (u8 *)__get_free_page(GFP_KERNEL); --- a/drivers/s390/crypto/zcrypt_cex4.c +++ b/drivers/s390/crypto/zcrypt_cex4.c @@ -85,8 +85,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, zc->online); + cca_get_info(ac->id, AUTOSEL_DOM, &ci, zc->online); return sysfs_emit(buf, "%s\n", ci.serial); }