Received: by 2002:a05:6520:4d:b0:139:a872:a4c9 with SMTP id i13csp2563278lkm; Mon, 20 Sep 2021 18:48:44 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwK698/nGPuq9X0uRkdLE9T187NhcPi3Kl4L7x4+3iIxVoVV9ROz1Ih0u8wS0tJD6QNuLEx X-Received: by 2002:a5d:9601:: with SMTP id w1mr3317673iol.209.1632188822379; Mon, 20 Sep 2021 18:47:02 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1632188822; cv=none; d=google.com; s=arc-20160816; b=scBZKBXEHAUgbPeVDOVDak2+CtoboXxx5vB9w1XYZAevnNde1NZ6r2/HD1NQIB1GFP WrOV5Ygn/wlOfhX2tniw0J/4ZsViEyQ9lIilCtfpgMt6MeItOY7A3QCimYpXwrS55QJg dwdKBHOIhXhJKl3ba6n/qELjFme7vybWIyQNBGA8jm6J98S+odaCTdWsTBeVE6AUITsS na0IPNpc+FKnzdF6EuV6IOMgQnHVYWCPClzj8bmTFgYkJeq0a/r3eWD1FkLr0iNLjLq6 BSNngtP8iQgmu1d9MLNG+esRy0aA42pneP7Y0U6pJwo6UvTk+Yu2Ag/jnQxD2Fy/0wdp lafw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=Cf/YtSQK6kKWTTnj+FAQBqSu+IOuvvK8NRySI1SclZM=; b=x/+7leCObDt6DPPvO1inwZWQbHTPvRhTrVdKOZTjIJOukiE9vQMZhtJp42TXASa0Cy mDWFwSbCGvVr4qq9sMAl9bx2VNbkEQEc4Z2Opisb6GkPzgqGbJEEicFy3zugnc5mD2+g f/GnkH0QdseLWA1h0/qBt2sKB/cQMiZQ7FNtOV0EZ+kEMuWKDzXs4TGfAA9wKp7V7tk3 UCwbuFQ7Wmibn09OrXNlr4qfTD5wKYVwkGFP1XbwKZahwVNVeSJ+plzef9d3kRBHT0VN UA/2Wkm4U17ktmpF1DhBdOhQb9Kph9yKYhApEIBpB2PY3ZyAhmHaRNekIfCLPTCimSmS 3aTw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=GJLsa3Wp; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id t6si13775382jaa.130.2021.09.20.18.46.51; Mon, 20 Sep 2021 18:47:02 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=GJLsa3Wp; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1346548AbhITRR7 (ORCPT + 99 others); Mon, 20 Sep 2021 13:17:59 -0400 Received: from mail.kernel.org ([198.145.29.99]:39998 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S245173AbhITRPf (ORCPT ); Mon, 20 Sep 2021 13:15:35 -0400 Received: by mail.kernel.org (Postfix) with ESMTPSA id 517A461211; Mon, 20 Sep 2021 16:58:44 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1632157124; bh=xGwExUppbd3H53PxpNT/Y7MZXZdRKAOroOEcEFe8Yis=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=GJLsa3WpulPQJe5+RP8n/gtj6TGYAkKFbpMVSv/xziVuX8bNPTQovOc9uY47Cnwi5 vQA/vjnIPppPG0SiJwti94lCnA34LBIqv4A3nDs0TTYB2uyNKNUkYM2BucVciU1k6n 2LH8f2AmMSH68TQX0sA51xxH0GbIzMCijBdIGoTI= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Vineeth Vijayan , Peter Oberparleiter , Vasily Gorbik , Sasha Levin Subject: [PATCH 4.14 037/217] s390/cio: add dev_busid sysfs entry for each subchannel Date: Mon, 20 Sep 2021 18:40:58 +0200 Message-Id: <20210920163925.892338560@linuxfoundation.org> X-Mailer: git-send-email 2.33.0 In-Reply-To: <20210920163924.591371269@linuxfoundation.org> References: <20210920163924.591371269@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Vineeth Vijayan [ Upstream commit d3683c055212bf910d4e318f7944910ce10dbee6 ] Introduce dev_busid, which exports the device-id associated with the io-subchannel (and message-subchannel). The dev_busid indicates that of the device which may be physically installed on the corrosponding subchannel. The dev_busid value "none" indicates that the subchannel is not valid, there is no I/O device currently associated with the subchannel. The dev_busid information would be helpful to write device-specific udev-rules associated with the subchannel. The dev_busid interface would be available even when the sch is not bound to any driver or if there is no operational device connected on it. Hence this attribute can be used to write udev-rules which are specific to the device associated with the subchannel. Signed-off-by: Vineeth Vijayan Reviewed-by: Peter Oberparleiter Signed-off-by: Vasily Gorbik Signed-off-by: Sasha Levin --- drivers/s390/cio/css.c | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/drivers/s390/cio/css.c b/drivers/s390/cio/css.c index e2026d54dd37..435e804b6b8b 100644 --- a/drivers/s390/cio/css.c +++ b/drivers/s390/cio/css.c @@ -330,9 +330,26 @@ static ssize_t pimpampom_show(struct device *dev, } static DEVICE_ATTR(pimpampom, 0444, pimpampom_show, NULL); +static ssize_t dev_busid_show(struct device *dev, + struct device_attribute *attr, + char *buf) +{ + struct subchannel *sch = to_subchannel(dev); + struct pmcw *pmcw = &sch->schib.pmcw; + + if ((pmcw->st == SUBCHANNEL_TYPE_IO || + pmcw->st == SUBCHANNEL_TYPE_MSG) && pmcw->dnv) + return sysfs_emit(buf, "0.%x.%04x\n", sch->schid.ssid, + pmcw->dev); + else + return sysfs_emit(buf, "none\n"); +} +static DEVICE_ATTR_RO(dev_busid); + static struct attribute *io_subchannel_type_attrs[] = { &dev_attr_chpids.attr, &dev_attr_pimpampom.attr, + &dev_attr_dev_busid.attr, NULL, }; ATTRIBUTE_GROUPS(io_subchannel_type); -- 2.30.2