Received: by 2002:a25:d7c1:0:0:0:0:0 with SMTP id o184csp913654ybg; Fri, 18 Oct 2019 09:11:39 -0700 (PDT) X-Google-Smtp-Source: APXvYqypHmf1wGpoCWPsH1IyzAD5a+dZH45jKKEp0xA0rVJ/5iA0CCasd2dFr9yc4JeawRfrOExd X-Received: by 2002:a17:906:35d6:: with SMTP id p22mr9390825ejb.274.1571415099594; Fri, 18 Oct 2019 09:11:39 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1571415099; cv=none; d=google.com; s=arc-20160816; b=0fcBNJy1UrLwi3zTKTIbQ8GrqYOB4qwD4G6RblLyPEyvu0XPcujWoVtnHRsdF3esmR wGKuE9Y7ZPitdV8xb1ZHc7ExboSfwL9Z5OhylWVOvMQ3E8XIHCKbiAxnFkzPAPy25Ucl tpP6AkOYgOrFiHJHLCwJuaKqaOdA0yygOnbiOp4YJK4LaCoGxOTxctAM51UmWToddQ91 XV7riI4a0G/I1cfPqE9MWETBWb4G5UGSHGxBfbIRnlAyWTkGMWWF2QKCvrlleNZ3/0ZL /blC8bnOxETi20YFw6217cJLpixsla31kyJP9QU+BFlE8g7Likox+YB3WTvtMYW5DGkf av4w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-disposition :content-transfer-encoding:mime-version:subject:to:from:date :message-id; bh=gPJeechTXuPDcgUjojxhAIQNHeHyd7g7k65lMeHiWZw=; b=L9RYO45h/zdwUqP99/zH2VS01cbo5a2nPoZaB2QC40IblzPQZbNpTw0/CQRRKENhMJ da86ZbPPqOszAmmEK/VrILWu2O50GHgOcQvHn2jve0GBYBX27uBjqJ4373aegSIVPe26 4vEvOLYMlNLGOmbpwUJXmPgPIoKrDEs5sjjBI3xg+4PFtTX6/oeahV8hOAFdOnEaZjd4 GnRcpiK9lcNy0Jiwn05Plknv4MC5FSd4LqoW0epJ8xlnasFq+Eba8HsRP5rCbJ0bxlmP VfBiSTF7Zb2+ZwU1SBAV/rzv2+5djWCeVoPMUGQ9vtN2OZxOsKsEjBHb5LLtiCDiGEAn qnVQ== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id g21si4196058edq.289.2019.10.18.09.11.16; Fri, 18 Oct 2019 09:11:39 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2394718AbfJQNhz convert rfc822-to-8bit (ORCPT + 99 others); Thu, 17 Oct 2019 09:37:55 -0400 Received: from mx2.uni-regensburg.de ([194.94.157.147]:50678 "EHLO mx2.uni-regensburg.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1729175AbfJQNhz (ORCPT ); Thu, 17 Oct 2019 09:37:55 -0400 X-Greylist: delayed 369 seconds by postgrey-1.27 at vger.kernel.org; Thu, 17 Oct 2019 09:37:54 EDT Received: from mx2.uni-regensburg.de (localhost [127.0.0.1]) by localhost (Postfix) with SMTP id DB8BD6000055 for ; Thu, 17 Oct 2019 15:31:42 +0200 (CEST) Received: from gwsmtp.uni-regensburg.de (gwsmtp1.uni-regensburg.de [132.199.5.51]) by mx2.uni-regensburg.de (Postfix) with ESMTP id B01026000053 for ; Thu, 17 Oct 2019 15:31:42 +0200 (CEST) Received: from uni-regensburg-smtp1-MTA by gwsmtp.uni-regensburg.de with Novell_GroupWise; Thu, 17 Oct 2019 15:31:42 +0200 Message-Id: <5DA86D3D020000A10003462F@gwsmtp.uni-regensburg.de> X-Mailer: Novell GroupWise Internet Agent 18.1.1 Date: Thu, 17 Oct 2019 15:31:41 +0200 From: "Ulrich Windl" To: Subject: Issue with reading sysfs files Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 8BIT Content-Disposition: inline Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hi! I wrote a simple tool to browse sysfs. However I noticed that there are some files having "r" (read) permission, but when you actually try to read from those, I get an I/O error. So I wonder whether the actual read was forgotten to implement, or the read permission should be gone actually. It seems to be implemented correctly in uevent, like # ll /sys/module/drm/uevent --w------- 1 root root 4096 Sep 24 12:24 /sys/module/drm/uevent but it is not (e.g.) for # ll /sys/devices/LNXSYSTM:00/LNXPWRBN:00/input/input1/event1/power/autosuspend_delay_ms -rw-r--r-- 1 root root 4096 Sep 26 14:03 /sys/devices/LNXSYSTM:00/LNXPWRBN:00/input/input1/event1/power/autosuspend_delay_ms # cat /sys/devices/LNXSYSTM:00/LNXPWRBN:00/input/input1/event1/power/autosuspend_delay_ms cat: '/sys/devices/LNXSYSTM:00/LNXPWRBN:00/input/input1/event1/power/autosuspend_delay_ms': Input/output error Here's a summary of such candidates: .../power/autosuspend_delay_ms # ll /sys/devices/pci0000:00/0000:00:03.1/0000:01:00.0/host2/rport-2:0-0/target2:0:0/2:0:0:1/block/sdb/queue/wbt_lat_usec -rw-r--r-- 1 root root 4096 Sep 26 14:03 /sys/devices/pci0000:00/0000:00:03.1/0000:01:00.0/host2/rport-2:0-0/target2:0:0/2:0:0:1/block/sdb/queue/wbt_lat_usec # cat /sys/devices/pci0000:00/0000:00:03.1/0000:01:00.0/host2/rport-2:0-0/target2:0:0/2:0:0:1/block/sdb/queue/wbt_lat_usec cat: '/sys/devices/pci0000:00/0000:00:03.1/0000:01:00.0/host2/rport-2:0-0/target2:0:0/2:0:0:1/block/sdb/queue/wbt_lat_usec': Invalid argument # ll /sys/devices/pci0000:00/0000:00:03.1/0000:01:00.0/resource0 -rw------- 1 root root 4096 Sep 26 14:03 /sys/devices/pci0000:00/0000:00:03.1/0000:01:00.0/resource0 # cat /sys/devices/pci0000:00/0000:00:03.1/0000:01:00.0/resource0 cat: '/sys/devices/pci0000:00/0000:00:03.1/0000:01:00.0/resource0': Input/output error /sys/devices/pci0000:00/0000:00:03.1/0000:01:00.0/resource2_wc # ll /sys/devices/pci0000:00/0000:00:03.1/0000:01:00.0/rom -rw------- 1 root root 262144 Sep 26 14:03 /sys/devices/pci0000:00/0000:00:03.1/0000:01:00.0/rom # cat /sys/devices/pci0000:00/0000:00:03.1/0000:01:00.0/rom cat: '/sys/devices/pci0000:00/0000:00:03.1/0000:01:00.0/rom': Invalid argument # ll /sys/devices/pci0000:80/0000:80:01.1/0000:81:00.0/net/em1/phys_port_id -r--r--r-- 1 root root 4096 Sep 26 14:03 /sys/devices/pci0000:80/0000:80:01.1/0000:81:00.0/net/em1/phys_port_id # cat /sys/devices/pci0000:80/0000:80:01.1/0000:81:00.0/net/em1/phys_port_id cat: '/sys/devices/pci0000:80/0000:80:01.1/0000:81:00.0/net/em1/phys_port_id': Operation not supported .../net/em1/phys_port_name .../net/em1/phys_switch_id # ll /sys/devices/pci0000:80/0000:80:01.2/0000:82:00.0/0000:83:00.0/graphics/fb0/bl_curve -rw-r--r-- 1 root root 4096 Sep 26 14:03 /sys/devices/pci0000:80/0000:80:01.2/0000:82:00.0/0000:83:00.0/graphics/fb0/bl_curve # cat /sys/devices/pci0000:80/0000:80:01.2/0000:82:00.0/0000:83:00.0/graphics/fb0/bl_curve cat: '/sys/devices/pci0000:80/0000:80:01.2/0000:82:00.0/0000:83:00.0/graphics/fb0/bl_curve': No such device # ll /sys/devices/pci0000:80/0000:80:08.1/0000:86:00.2/ata1/host1/scsi_host/host1/em_buffer -rw-r--r-- 1 root root 4096 Oct 17 15:25 /sys/devices/pci0000:80/0000:80:08.1/0000:86:00.2/ata1/host1/scsi_host/host1/em_buffer # cat /sys/devices/pci0000:80/0000:80:08.1/0000:86:00.2/ata1/host1/scsi_host/host1/em_buffer cat: '/sys/devices/pci0000:80/0000:80:08.1/0000:86:00.2/ata1/host1/scsi_host/host1/em_buffer': Invalid argument .../em_message # ll /sys/devices/pci0000:c0/0000:c0:01.1/0000:c1:00.0/host0/scsi_host/host0/fw_crash_buffer -rw-r--r-- 1 root root 4096 Sep 26 14:03 /sys/devices/pci0000:c0/0000:c0:01.1/0000:c1:00.0/host0/scsi_host/host0/fw_crash_buffer # cat /sys/devices/pci0000:c0/0000:c0:01.1/0000:c1:00.0/host0/scsi_host/host0/fw_crash_buffer cat: '/sys/devices/pci0000:c0/0000:c0:01.1/0000:c1:00.0/host0/scsi_host/host0/fw_crash_buffer': Invalid argument # ll /sys/devices/pci0000:c0/0000:c0:01.1/0000:c1:00.0/host0/target0:2:0/0:2:0:0/block/sda/sda1/trace/act_mask -rw-r--r-- 1 root root 4096 Sep 26 14:03 /sys/devices/pci0000:c0/0000:c0:01.1/0000:c1:00.0/host0/target0:2:0/0:2:0:0/block/sda/sda1/trace/act_mask # cat /sys/devices/pci0000:c0/0000:c0:01.1/0000:c1:00.0/host0/target0:2:0/0:2:0:0/block/sda/sda1/trace/act_mask cat: '/sys/devices/pci0000:c0/0000:c0:01.1/0000:c1:00.0/host0/target0:2:0/0:2:0:0/block/sda/sda1/trace/act_mask': No such device or address .../block/sda/sda1/trace/enable .../block/sda/sda1/trace/end_lba .../block/sda/sda1/trace/pid .../block/sda/sda1/trace/start_lba # ll /sys/devices/virtual/net/lo/duplex -r--r--r-- 1 root root 4096 Sep 24 12:30 /sys/devices/virtual/net/lo/duplex # cat /sys/devices/virtual/net/lo/duplex cat: /sys/devices/virtual/net/lo/duplex: Invalid argument # ll /sys/devices/virtual/net/lo/name_assign_type -r--r--r-- 1 root root 4096 Sep 24 12:24 /sys/devices/virtual/net/lo/name_assign_type # cat /sys/devices/virtual/net/lo/name_assign_type cat: /sys/devices/virtual/net/lo/name_assign_type: Invalid argument /sys/devices/virtual/net/lo/speed Found in 4.12.14-95.6-default of SLES SP4 (x86_64) Regards, Ulrich