Received: by 2002:a05:6a10:6d25:0:0:0:0 with SMTP id gq37csp1884581pxb; Mon, 13 Sep 2021 07:31:04 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyCyJ1y+githUuh9t4QqQXyxxkWGUSOm7BqDQ47ivWSKShlky7TeEvOjJyP1IiJBYtHEKOs X-Received: by 2002:a05:6638:22d1:: with SMTP id j17mr8009667jat.129.1631543464368; Mon, 13 Sep 2021 07:31:04 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1631543464; cv=none; d=google.com; s=arc-20160816; b=BV2MHgS6UmdEBI1f9FPvbVIXf+BJ8Wgqx/asN9sDEQ2OWea1hqsQi+eFWTgG3limla a+6IUvCftMZnXl+NF0TpqgppLynGxdtA3PLQXPBvVL8HRBTLz0a1epQOyd4vBRwMq22F 1rFdFZ65/iNQisezP7OEcYshRaWvQZ6MGhMDwP9HsimgpumHZO26nFW6b88j4C4+UmIS K1ip6RmE+TyaSfwfrFmSjwXMUPOxIzT9UNklroCGBVFDoQ5jg3nwRxntAZV9DGTAZI2z a6+hxNtDfXFPHA444Dl7ij9PphiALYleRe8waxXWUH77PiOlDm3BvGx1Dob4UQgKHnhb dPGA== 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=rpcBHlLIkVZ1xFXIH6bDAPuE2ATYHk1I/ekfMo7Ts8M=; b=ZBCfPNA+UuF2TUSwOvbQS06qx9Nhh6sPUt7yaea7m4Ft+QRrv0s71/fe5cAcCrJCLh PD5j99ZzEjBcQiOaKM4AHqmZbvRfI6vSbLddt+xMP8PpjD1A3oiMIqessOvu+oPpkref +2kltjP0MI5GeTQVrdZKLbziX/3KTCOom9UCOs0ds6V6J3VxUbqY9MWhmhnsJu4fe29L 6TCMyleWuEnfZbFU8zi/9mFMdtsHnA9n15uHX+b35Mn4QZKCNXaCl53hcoO+4LDTNgwH LIz44AYoxZBMxqbnCP7MHOkMxbzneyu76fpFTHuy7EG1w+nKs0lyXk9DxmyYFQ0miycX mCvw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=tydI5aZs; 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 n10si7210725iog.43.2021.09.13.07.30.50; Mon, 13 Sep 2021 07:31:04 -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=tydI5aZs; 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 S1344363AbhIMO2v (ORCPT + 99 others); Mon, 13 Sep 2021 10:28:51 -0400 Received: from mail.kernel.org ([198.145.29.99]:45414 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1345503AbhIMOWs (ORCPT ); Mon, 13 Sep 2021 10:22:48 -0400 Received: by mail.kernel.org (Postfix) with ESMTPSA id 4DE6A61390; Mon, 13 Sep 2021 13:47:48 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1631540868; bh=CsjYALVIpDrXms1/IH5MyVOgUNBA0DQFj67fi+aflx0=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=tydI5aZsouYmNqP47syYmiAY1sNCrDB/m5GLUzWG63Tnh0WJGuHkaZs+sQ2wTw2X4 yTcl4u/cz5dC7y6iz0zmCZjlwJ4GhRSPzvUBwi8VWj7ZAXoNixmsAc8Rpmaod1FOCC jD+gcqFomIvJgRHOu5cKxqFgIIjYh1RKX0Ody3E4= 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 5.14 025/334] s390/cio: add dev_busid sysfs entry for each subchannel Date: Mon, 13 Sep 2021 15:11:19 +0200 Message-Id: <20210913131114.263107419@linuxfoundation.org> X-Mailer: git-send-email 2.33.0 In-Reply-To: <20210913131113.390368911@linuxfoundation.org> References: <20210913131113.390368911@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 a974943c27da..9fcdb8d81eee 100644 --- a/drivers/s390/cio/css.c +++ b/drivers/s390/cio/css.c @@ -430,9 +430,26 @@ static ssize_t pimpampom_show(struct device *dev, } static DEVICE_ATTR_RO(pimpampom); +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