From: Jean Delvare <khali@linux-fr.org>
To: lm-sensors@vger.kernel.org
Subject: [lm-sensors] [PATCH] sensors-detect: Skip "random" I/O port probing
Date: Mon, 18 Feb 2008 21:33:17 +0000 [thread overview]
Message-ID: <20080218223317.2142dc16@hyperion.delvare> (raw)
Hi all,
As a follow-up of this discussion on LKML:
http://lkml.org/lkml/2008/2/13/390
I would like to propose the following patch to sensors-detect:
Index: prog/detect/sensors-detect
=================================--- prog/detect/sensors-detect (révision 5123)
+++ prog/detect/sensors-detect (copie de travail)
@@ -3,7 +3,7 @@
#
# sensors-detect - Detect PCI bus and chips
# Copyright (C) 1998 - 2002 Frodo Looijaard <frodol@dds.nl>
-# Copyright (C) 2004 - 2007 Jean Delvare <khali@linux-fr.org>
+# Copyright (C) 2004 - 2008 Jean Delvare <khali@linux-fr.org>
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
@@ -2366,12 +2366,13 @@
# [2] -> SUBLEVEL
# [3] -> EXTRAVERSION
#
-use vars qw(@kernel_version);
+use vars qw(@kernel_version $kernel_arch);
sub initialize_kernel_version
{
`uname -r` =~ /(\d+)\.(\d+)\.(\d+)(.*)/;
@kernel_version = ($1, $2, $3, $4);
+ $kernel_arch = `uname -m`;
}
sub kernel_version_at_least
@@ -5810,27 +5811,32 @@
}
print "\n";
- print "Some chips are also accessible through the ISA I/O ports. We have to\n".
- "write to arbitrary I/O ports to probe them. This is usually safe though.\n".
- "Yes, you do have ISA I/O ports even if you do not have any ISA slots!\n";
- print "Do you want to scan the ISA I/O ports? (YES/no): ";
- unless (<STDIN> =~ /^\s*n/i) {
- initialize_ioports();
- scan_isa_bus();
- close_ioports();
- }
- print "\n";
+ # Skip "random" I/O port probing on PPC
+ if ($kernel_arch ne 'ppc'
+ && $kernel_arch ne 'ppc64'
+ && $kernel_arch ne 'powerpc') {
+ print "Some chips are also accessible through the ISA I/O ports. We have to\n".
+ "write to arbitrary I/O ports to probe them. This is usually safe though.\n".
+ "Yes, you do have ISA I/O ports even if you do not have any ISA slots!\n";
+ print "Do you want to scan the ISA I/O ports? (YES/no): ";
+ unless (<STDIN> =~ /^\s*n/i) {
+ initialize_ioports();
+ scan_isa_bus();
+ close_ioports();
+ }
+ print "\n";
- print "Some Super I/O chips may also contain sensors. We have to write to\n".
- "standard I/O ports to probe them. This is usually safe.\n";
- print "Do you want to scan for Super I/O sensors? (YES/no): ";
- unless (<STDIN> =~ /^\s*n/i) {
- initialize_ioports();
- scan_superio(0x2e, 0x2f);
- scan_superio(0x4e, 0x4f);
- close_ioports();
+ print "Some Super I/O chips may also contain sensors. We have to write to\n".
+ "standard I/O ports to probe them. This is usually safe.\n";
+ print "Do you want to scan for Super I/O sensors? (YES/no): ";
+ unless (<STDIN> =~ /^\s*n/i) {
+ initialize_ioports();
+ scan_superio(0x2e, 0x2f);
+ scan_superio(0x4e, 0x4f);
+ close_ioports();
+ }
+ print "\n";
}
- print "\n";
print "Some CPUs or memory controllers may also contain embedded sensors.\n";
print "Do you want to scan for them? (YES/no): ";
The idea is to skip "random" I/O port probing on PPC, as it won't find
anything anyway and can cause the kernel to oops.
Christian, can you please test this patch and confirm that it solves
your problem?
Ben, can you please comment on this patch? I'm not familiar with the
PPC architecture at all so I'm not sure if I am looking for the right
strings.
Thanks,
--
Jean Delvare
_______________________________________________
lm-sensors mailing list
lm-sensors@lm-sensors.org
http://lists.lm-sensors.org/mailman/listinfo/lm-sensors
next reply other threads:[~2008-02-18 21:33 UTC|newest]
Thread overview: 12+ messages / expand[flat|nested] mbox.gz Atom feed top
2008-02-18 21:33 Jean Delvare [this message]
2008-02-18 22:46 ` [lm-sensors] [PATCH] sensors-detect: Skip "random" I/O port Benjamin Herrenschmidt
2008-02-20 19:07 ` Jean Delvare
2008-02-21 10:02 ` Christian Krafft
2008-02-21 10:09 ` Jean Delvare
2008-02-21 22:49 ` Benjamin Herrenschmidt
2008-02-22 7:19 ` Jean Delvare
2008-02-22 7:21 ` Benjamin Herrenschmidt
2008-02-22 7:44 ` Jean Delvare
2008-02-22 10:18 ` Christian Krafft
2008-02-22 21:26 ` Benjamin Herrenschmidt
2008-02-22 22:22 ` [lm-sensors] [PATCH] sensors-detect: Skip "random" I/O Benjamin Herrenschmidt
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20080218223317.2142dc16@hyperion.delvare \
--to=khali@linux-fr.org \
--cc=lm-sensors@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.