Received: by 2002:a05:6a10:6d25:0:0:0:0 with SMTP id gq37csp1838263pxb; Mon, 13 Sep 2021 06:39:56 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyzW8nYXbppWefxn7dspujwH1O7ewUio3CyzCGhy85PG4kQnSqsBw9UVACpKV4OSwz0Yynt X-Received: by 2002:a05:6638:4122:: with SMTP id ay34mr9979520jab.131.1631540396033; Mon, 13 Sep 2021 06:39:56 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1631540396; cv=none; d=google.com; s=arc-20160816; b=Yq8GxPnGegJK4IJZHOkD8/kdhLGY+5M+vPgRwEYWTmPqpfzXuqs+zGHEet/MXl884S jg8Z0qonFtjNPAsyoPvAr8UMlZ7/O7Q2YwimMVm8VZFaAWuMfZzw8ltP1YkTrzi7xZ5n qK13Uae5JiJvoPkeGo7H6+3YAsnJVdyVb03bRz1JGTApgpy8RJ65umVIdtzNaQj5KqCT E3gC0wvKGDmeAlW6ip/rAUN3Xf/4Xld42UevwpxPmpCll7MV2tE/vHzBO8wZMDxhx/aA 0iTsNkAQ904GkT07TLyezmOl175LuUg7F+2xtV3tQS86Szl2ukg85Dnvo80NMzq030l3 MEBA== 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=6yx1x4tu0jXoVgxI7LDTQByZtKE3pwncaNw7d355WoI=; b=i2zpqAZFm/m6FvbcY6cOf2iL+7hdzjU6oPxmldfz0Rl0+fKw0gkx0ejufQTcSTqgqE dIne0Xm5ZrUeGKWj1oS2vRySUrhnQxVSBMJeZ48Wx033jbkoWrZSGko0hYy1gCQD6vnN gsILFaclhLj/aVcorqDW5YNkBDEW8om7PsHg0R/fCF/LyZi0DzlhKNUT4Tos4OtzrFsl JldJe+qocpots4tnYPBuxqDSPYnHePM3J1QaURw5P/0cuJtaFnQXpyLfThMHYE12DuNF MiSzbWWEdU31dPdbSpLSM4BybN+AV8ivqNfq43u+43bTGDVep3v9TOcUzSx1KDCPjH7K hOzQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b="0/Lw0mUn"; 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 g8si6539497ioq.76.2021.09.13.06.39.43; Mon, 13 Sep 2021 06:39:56 -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="0/Lw0mUn"; 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 S243432AbhIMNjb (ORCPT + 99 others); Mon, 13 Sep 2021 09:39:31 -0400 Received: from mail.kernel.org ([198.145.29.99]:46794 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S242392AbhIMN3W (ORCPT ); Mon, 13 Sep 2021 09:29:22 -0400 Received: by mail.kernel.org (Postfix) with ESMTPSA id F283161283; Mon, 13 Sep 2021 13:23:56 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1631539437; bh=5rleiisEq+XyVmQ7RxgaVx7q1iFSXMHn9eJxCAABnI4=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=0/Lw0mUn/NzKyFb7mJFfkPdx4QKuoeRZ1DhYRkPSNT8cG6E9yDK0HgKEVtVDVwvkE YHsoR3idXi6NZ7q1xhAutZ3SLB/60KCuc5Pm5heDHJ/2DCkGttO25ash4cmnquFNeh 3dJqYsdcb9dyOeM64BRoszCk+UwvVT/miVy5JE8s= 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.10 024/236] s390/cio: add dev_busid sysfs entry for each subchannel Date: Mon, 13 Sep 2021 15:12:09 +0200 Message-Id: <20210913131101.167807071@linuxfoundation.org> X-Mailer: git-send-email 2.33.0 In-Reply-To: <20210913131100.316353015@linuxfoundation.org> References: <20210913131100.316353015@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 cca1a7c4bb33..305db4173dcf 100644 --- a/drivers/s390/cio/css.c +++ b/drivers/s390/cio/css.c @@ -426,9 +426,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