2004-01-27 23:33:09

by Greg KH

[permalink] [raw]
Subject: [BK PATCH] i2c driver fixes for 2.6.2-rc2

Hi,

Here are some i2c driver fixes for 2.6.2-rc2. It's all a bit of small
bugfixes and documentation updates.

Please pull from: bk://kernel.bkbits.net/gregkh/linux/i2c-2.6

Individual patches will follow, sent to the sensors and linux-kernel
lists.

thanks,

greg k-h

Documentation/i2c/porting-clients | 5 --
drivers/i2c/busses/i2c-parport.h | 7 ++-
drivers/i2c/busses/i2c-philips-par.c | 4 +-
drivers/i2c/busses/i2c-piix4.c | 48 +++++++++++++-----------
drivers/i2c/chips/lm75.c | 12 +++---
drivers/i2c/chips/lm78.c | 12 +++---
drivers/i2c/chips/lm85.c | 69 ++++++++++-------------------------
7 files changed, 67 insertions(+), 90 deletions(-)
-----


Greg Kroah-Hartman:
o I2C: remove printk() calls in lm85, and clean up debug logic

Jean Delvare:
o I2C: Bring lm75 and lm78 in compliance with sysfs naming conventions
o I2C: Add ADM1025EB support to i2c-parport
o I2C: Fix bus reset in i2c-philips-par
o I2C: undo documentation change

Mark M. Hoffman:
o I2C: i2c-piix4.c bugfix


2004-01-27 23:36:21

by Greg KH

[permalink] [raw]
Subject: [PATCH] i2c driver fixes for 2.6.2-rc2

ChangeSet 1.1474.148.1, 2004/01/23 17:14:22-08:00, [email protected]

[PATCH] I2C: i2c-piix4.c bugfix

This patch fixes a "Trying to release non-existent resource" error that
occurs during rmmod when the device isn't actually present. It includes
some other cleanups too: error paths, whitespace, magic numbers, __devinit.


drivers/i2c/busses/i2c-piix4.c | 48 +++++++++++++++++++++++------------------
1 files changed, 27 insertions(+), 21 deletions(-)


diff -Nru a/drivers/i2c/busses/i2c-piix4.c b/drivers/i2c/busses/i2c-piix4.c
--- a/drivers/i2c/busses/i2c-piix4.c Tue Jan 27 15:27:30 2004
+++ b/drivers/i2c/busses/i2c-piix4.c Tue Jan 27 15:27:30 2004
@@ -68,6 +68,9 @@
#define SMBSLVEVT (0xA + piix4_smba)
#define SMBSLVDAT (0xC + piix4_smba)

+/* count for request_region */
+#define SMBIOSIZE 8
+
/* PCI Address Constants */
#define SMBBA 0x090
#define SMBHSTCFG 0x0D2
@@ -112,14 +115,13 @@

static int piix4_transaction(void);

-
static unsigned short piix4_smba = 0;
static struct i2c_adapter piix4_adapter;

/*
* Get DMI information.
*/
-static int ibm_dmi_probe(void)
+static int __devinit ibm_dmi_probe(void)
{
#ifdef CONFIG_X86
extern int is_unsafe_smbus;
@@ -129,9 +131,9 @@
#endif
}

-static int piix4_setup(struct pci_dev *PIIX4_dev, const struct pci_device_id *id)
+static int __devinit piix4_setup(struct pci_dev *PIIX4_dev,
+ const struct pci_device_id *id)
{
- int error_return = 0;
unsigned char temp;

/* match up the function */
@@ -144,8 +146,7 @@
dev_err(&PIIX4_dev->dev, "IBM Laptop detected; this module "
"may corrupt your serial eeprom! Refusing to load "
"module!\n");
- error_return = -EPERM;
- goto END;
+ return -EPERM;
}

/* Determine the address of the SMBus areas */
@@ -163,11 +164,10 @@
}
}

- if (!request_region(piix4_smba, 8, "piix4-smbus")) {
+ if (!request_region(piix4_smba, SMBIOSIZE, "piix4-smbus")) {
dev_err(&PIIX4_dev->dev, "SMB region 0x%x already in use!\n",
piix4_smba);
- error_return = -ENODEV;
- goto END;
+ return -ENODEV;
}

pci_read_config_byte(PIIX4_dev, SMBHSTCFG, &temp);
@@ -214,8 +214,9 @@
} else {
dev_err(&PIIX4_dev->dev,
"Host SMBus controller not enabled!\n");
- error_return = -ENODEV;
- goto END;
+ release_region(piix4_smba, SMBIOSIZE);
+ piix4_smba = 0;
+ return -ENODEV;
}
}

@@ -231,8 +232,7 @@
dev_dbg(&PIIX4_dev->dev, "SMBREV = 0x%X\n", temp);
dev_dbg(&PIIX4_dev->dev, "SMBA = 0x%X\n", piix4_smba);

-END:
- return error_return;
+ return 0;
}

/* Another internally used function */
@@ -465,7 +465,8 @@
{ 0, }
};

-static int __devinit piix4_probe(struct pci_dev *dev, const struct pci_device_id *id)
+static int __devinit piix4_probe(struct pci_dev *dev,
+ const struct pci_device_id *id)
{
int retval;

@@ -479,17 +480,24 @@
snprintf(piix4_adapter.name, I2C_NAME_SIZE,
"SMBus PIIX4 adapter at %04x", piix4_smba);

- retval = i2c_add_adapter(&piix4_adapter);
+ if ((retval = i2c_add_adapter(&piix4_adapter))) {
+ dev_err(&dev->dev, "Couldn't register adapter!\n");
+ release_region(piix4_smba, SMBIOSIZE);
+ piix4_smba = 0;
+ }

return retval;
}

static void __devexit piix4_remove(struct pci_dev *dev)
{
- i2c_del_adapter(&piix4_adapter);
+ if (piix4_smba) {
+ i2c_del_adapter(&piix4_adapter);
+ release_region(piix4_smba, SMBIOSIZE);
+ piix4_smba = 0;
+ }
}

-
static struct pci_driver piix4_driver = {
.name = "piix4-smbus",
.id_table = piix4_ids,
@@ -502,15 +510,13 @@
return pci_module_init(&piix4_driver);
}

-
static void __exit i2c_piix4_exit(void)
{
pci_unregister_driver(&piix4_driver);
- release_region(piix4_smba, 8);
}

-MODULE_AUTHOR
- ("Frodo Looijaard <[email protected]> and Philip Edelbrock <[email protected]>");
+MODULE_AUTHOR("Frodo Looijaard <[email protected]> and "
+ "Philip Edelbrock <[email protected]>");
MODULE_DESCRIPTION("PIIX4 SMBus driver");
MODULE_LICENSE("GPL");


2004-01-27 23:36:49

by Greg KH

[permalink] [raw]
Subject: Re: [PATCH] i2c driver fixes for 2.6.2-rc2

ChangeSet 1.1474.148.6, 2004/01/27 14:46:05-08:00, [email protected]

[PATCH] I2C: remove printk() calls in lm85, and clean up debug logic.


drivers/i2c/chips/lm85.c | 69 ++++++++++++++---------------------------------
1 files changed, 21 insertions(+), 48 deletions(-)


diff -Nru a/drivers/i2c/chips/lm85.c b/drivers/i2c/chips/lm85.c
--- a/drivers/i2c/chips/lm85.c Tue Jan 27 15:26:35 2004
+++ b/drivers/i2c/chips/lm85.c Tue Jan 27 15:26:35 2004
@@ -48,9 +48,6 @@
/* Insmod parameters */
SENSORS_INSMOD_4(lm85b, lm85c, adm1027, adt7463);

-/* Enable debug if true */
-static int lm85debug = 0;
-
/* The LM85 registers */

#define LM85_REG_IN(nr) (0x20 + (nr))
@@ -802,19 +799,15 @@
company = lm85_read_value(new_client, LM85_REG_COMPANY);
verstep = lm85_read_value(new_client, LM85_REG_VERSTEP);

- if (lm85debug) {
- printk("lm85: Detecting device at %d,0x%02x with"
+ dev_dbg(&adapter->dev, "Detecting device at %d,0x%02x with"
" COMPANY: 0x%02x and VERSTEP: 0x%02x\n",
i2c_adapter_id(new_client->adapter), new_client->addr,
company, verstep);
- }

/* If auto-detecting, Determine the chip type. */
if (kind <= 0) {
- if (lm85debug) {
- printk("lm85: Autodetecting device at %d,0x%02x ...\n",
+ dev_dbg(&adapter->dev, "Autodetecting device at %d,0x%02x ...\n",
i2c_adapter_id(adapter), address );
- }
if( company == LM85_COMPANY_NATIONAL
&& verstep == LM85_VERSTEP_LM85C ) {
kind = lm85c ;
@@ -823,8 +816,8 @@
kind = lm85b ;
} else if( company == LM85_COMPANY_NATIONAL
&& (verstep & 0xf0) == LM85_VERSTEP_GENERIC ) {
- printk("lm85: Unrecgonized version/stepping 0x%02x"
- " Defaulting to LM85.\n", verstep );
+ dev_err(&adapter->dev, "Unrecgonized version/stepping 0x%02x"
+ " Defaulting to LM85.\n", verstep);
kind = any_chip ;
} else if( company == LM85_COMPANY_ANALOG_DEV
&& verstep == LM85_VERSTEP_ADM1027 ) {
@@ -834,21 +827,19 @@
kind = adt7463 ;
} else if( company == LM85_COMPANY_ANALOG_DEV
&& (verstep & 0xf0) == LM85_VERSTEP_GENERIC ) {
- printk("lm85: Unrecgonized version/stepping 0x%02x"
- " Defaulting to ADM1027.\n", verstep );
+ dev_err(&adapter->dev, "Unrecgonized version/stepping 0x%02x"
+ " Defaulting to ADM1027.\n", verstep);
kind = adm1027 ;
} else if( kind == 0 && (verstep & 0xf0) == 0x60) {
- printk("lm85: Generic LM85 Version 6 detected\n");
+ dev_err(&adapter->dev, "Generic LM85 Version 6 detected\n");
/* Leave kind as "any_chip" */
} else {
- if (lm85debug) {
- printk("lm85: Autodetection failed\n");
- }
+ dev_dbg(&adapter->dev, "Autodetection failed\n");
/* Not an LM85 ... */
if( kind == 0 ) { /* User used force=x,y */
- printk("lm85: Generic LM85 Version 6 not"
- " found at %d,0x%02x. Try force_lm85c.\n",
- i2c_adapter_id(adapter), address );
+ dev_err(&adapter->dev, "Generic LM85 Version 6 not"
+ " found at %d,0x%02x. Try force_lm85c.\n",
+ i2c_adapter_id(adapter), address );
}
err = 0 ;
goto ERROR1;
@@ -879,12 +870,10 @@
data->valid = 0;
init_MUTEX(&data->update_lock);

- if (lm85debug) {
- printk("lm85: Assigning ID %d to %s at %d,0x%02x\n",
+ dev_dbg(&adapter->dev, "Assigning ID %d to %s at %d,0x%02x\n",
new_client->id, new_client->name,
i2c_adapter_id(new_client->adapter),
new_client->addr);
- }

/* Tell the I2C layer a new client has arrived */
if ((err = i2c_attach_client(new_client)))
@@ -1021,31 +1010,24 @@
int value;
struct lm85_data *data = i2c_get_clientdata(client);

- if (lm85debug) {
- printk("lm85(%d): Initializing device\n", client->id);
- }
+ dev_dbg(&client->dev, "Initializing device\n");

/* Warn if part was not "READY" */
value = lm85_read_value(client, LM85_REG_CONFIG);
- if (lm85debug) {
- printk("lm85(%d): LM85_REG_CONFIG is: 0x%02x\n", client->id, value );
- }
+ dev_dbg(&client->dev, "LM85_REG_CONFIG is: 0x%02x\n", value);
if( value & 0x02 ) {
- printk("lm85(%d): Client (%d,0x%02x) config is locked.\n",
- client->id,
+ dev_err(&client->dev, "Client (%d,0x%02x) config is locked.\n",
i2c_adapter_id(client->adapter), client->addr );
};
if( ! (value & 0x04) ) {
- printk("lm85(%d): Client (%d,0x%02x) is not ready.\n",
- client->id,
+ dev_err(&client->dev, "Client (%d,0x%02x) is not ready.\n",
i2c_adapter_id(client->adapter), client->addr );
};
if( value & 0x10
&& ( data->type == adm1027
|| data->type == adt7463 ) ) {
- printk("lm85(%d): Client (%d,0x%02x) VxI mode is set. "
+ dev_err(&client->dev, "Client (%d,0x%02x) VxI mode is set. "
"Please report this to the lm85 maintainer.\n",
- client->id,
i2c_adapter_id(client->adapter), client->addr );
};

@@ -1061,11 +1043,8 @@
value = lm85_read_value(client, LM85_REG_CONFIG);
/* Try to clear LOCK, Set START, save everything else */
value = (value & ~ 0x02) | 0x01 ;
- if (lm85debug) {
- printk("lm85(%d): Setting CONFIG to: 0x%02x\n", client->id, value );
- }
+ dev_dbg(&client->dev, "Setting CONFIG to: 0x%02x\n", value);
lm85_write_value(client, LM85_REG_CONFIG, value);
-
}

void lm85_update_client(struct i2c_client *client)
@@ -1078,10 +1057,8 @@
if ( !data->valid ||
(jiffies - data->last_reading > LM85_DATA_INTERVAL ) ) {
/* Things that change quickly */
-
- if (lm85debug) {
- printk("lm85(%d): Reading sensor values\n", client->id);
- }
+ dev_dbg(&client->dev, "Reading sensor values\n");
+
/* Have to read extended bits first to "freeze" the
* more significant bits that are read later.
*/
@@ -1125,10 +1102,8 @@
if ( !data->valid ||
(jiffies - data->last_config > LM85_CONFIG_INTERVAL) ) {
/* Things that don't change often */
+ dev_dbg(&client->dev, "Reading config values\n");

- if (lm85debug) {
- printk("lm85(%d): Reading config values\n", client->id);
- }
for (i = 0; i <= 4; ++i) {
data->in_min[i] =
lm85_read_value(client, LM85_REG_IN_MIN(i));
@@ -1234,8 +1209,6 @@
MODULE_LICENSE("GPL");
MODULE_AUTHOR("Philip Pokorny <[email protected]>, Margit Schubert-While <[email protected]>");
MODULE_DESCRIPTION("LM85-B, LM85-C driver");
-MODULE_PARM(lm85debug, "i");
-MODULE_PARM_DESC(lm85debug, "Enable debugging statements");

module_init(sm_lm85_init);
module_exit(sm_lm85_exit);

2004-01-27 23:39:10

by Greg KH

[permalink] [raw]
Subject: Re: [PATCH] i2c driver fixes for 2.6.2-rc2

ChangeSet 1.1474.148.3, 2004/01/23 17:14:52-08:00, [email protected]

[PATCH] I2C: Fix bus reset in i2c-philips-par

This patch fixes the bus reset in i2c-philips-par when it is loaded with
type!=0. For now, the reset is always made as is type==0. I guess that
this driver will be abandoned in a while, but it probably doesn't hurt
to fix that.


drivers/i2c/busses/i2c-philips-par.c | 4 ++--
1 files changed, 2 insertions(+), 2 deletions(-)


diff -Nru a/drivers/i2c/busses/i2c-philips-par.c b/drivers/i2c/busses/i2c-philips-par.c
--- a/drivers/i2c/busses/i2c-philips-par.c Tue Jan 27 15:27:08 2004
+++ b/drivers/i2c/busses/i2c-philips-par.c Tue Jan 27 15:27:08 2004
@@ -184,8 +184,8 @@
return;
}
/* reset hardware to sane state */
- bit_lp_setsda(port, 1);
- bit_lp_setscl(port, 1);
+ adapter->bit_lp_data.setsda(port, 1);
+ adapter->bit_lp_data.setscl(port, 1);
parport_release(adapter->pdev);

if (i2c_bit_add_bus(&adapter->adapter) < 0) {

2004-01-27 23:39:07

by Greg KH

[permalink] [raw]
Subject: Re: [PATCH] i2c driver fixes for 2.6.2-rc2

ChangeSet 1.1474.148.5, 2004/01/27 14:38:29-08:00, [email protected]

[PATCH] I2C: Bring lm75 and lm78 in compliance with sysfs naming conventions

Here is a patch that brings the lm75 and lm78 drivers in compliance with
sysfs naming conventions. The drivers as found in existing 2.6 kernels
do not have a digit appended to the temperature-related files names as
the sysfs naming conversion recommends (obviously because they each have
a single temperature channel). As a result, libsensors won't find the
files.

It was discussed on the list wether a '1' should be appended in this
case, and our conclusion was that it would be better to do so because it
helps automatic processing of the sysfs exported files. Please apply if
you agree with this.


drivers/i2c/chips/lm75.c | 12 ++++++------
drivers/i2c/chips/lm78.c | 12 ++++++------
2 files changed, 12 insertions(+), 12 deletions(-)


diff -Nru a/drivers/i2c/chips/lm75.c b/drivers/i2c/chips/lm75.c
--- a/drivers/i2c/chips/lm75.c Tue Jan 27 15:26:46 2004
+++ b/drivers/i2c/chips/lm75.c Tue Jan 27 15:26:46 2004
@@ -104,9 +104,9 @@
set(temp_max, LM75_REG_TEMP_OS);
set(temp_hyst, LM75_REG_TEMP_HYST);

-static DEVICE_ATTR(temp_max, S_IWUSR | S_IRUGO, show_temp_max, set_temp_max);
-static DEVICE_ATTR(temp_hyst, S_IWUSR | S_IRUGO, show_temp_hyst, set_temp_hyst);
-static DEVICE_ATTR(temp_input, S_IRUGO, show_temp_input, NULL);
+static DEVICE_ATTR(temp_max1, S_IWUSR | S_IRUGO, show_temp_max, set_temp_max);
+static DEVICE_ATTR(temp_hyst1, S_IWUSR | S_IRUGO, show_temp_hyst, set_temp_hyst);
+static DEVICE_ATTR(temp_input1, S_IRUGO, show_temp_input, NULL);

static int lm75_attach_adapter(struct i2c_adapter *adapter)
{
@@ -197,9 +197,9 @@
lm75_init_client(new_client);

/* Register sysfs hooks */
- device_create_file(&new_client->dev, &dev_attr_temp_max);
- device_create_file(&new_client->dev, &dev_attr_temp_hyst);
- device_create_file(&new_client->dev, &dev_attr_temp_input);
+ device_create_file(&new_client->dev, &dev_attr_temp_max1);
+ device_create_file(&new_client->dev, &dev_attr_temp_hyst1);
+ device_create_file(&new_client->dev, &dev_attr_temp_input1);

return 0;

diff -Nru a/drivers/i2c/chips/lm78.c b/drivers/i2c/chips/lm78.c
--- a/drivers/i2c/chips/lm78.c Tue Jan 27 15:26:46 2004
+++ b/drivers/i2c/chips/lm78.c Tue Jan 27 15:26:46 2004
@@ -369,10 +369,10 @@
return count;
}

-static DEVICE_ATTR(temp_input, S_IRUGO, show_temp, NULL)
-static DEVICE_ATTR(temp_max, S_IRUGO | S_IWUSR,
+static DEVICE_ATTR(temp_input1, S_IRUGO, show_temp, NULL)
+static DEVICE_ATTR(temp_max1, S_IRUGO | S_IWUSR,
show_temp_over, set_temp_over)
-static DEVICE_ATTR(temp_hyst, S_IRUGO | S_IWUSR,
+static DEVICE_ATTR(temp_hyst1, S_IRUGO | S_IWUSR,
show_temp_hyst, set_temp_hyst)

/* 3 Fans */
@@ -678,9 +678,9 @@
device_create_file(&new_client->dev, &dev_attr_in_input6);
device_create_file(&new_client->dev, &dev_attr_in_min6);
device_create_file(&new_client->dev, &dev_attr_in_max6);
- device_create_file(&new_client->dev, &dev_attr_temp_input);
- device_create_file(&new_client->dev, &dev_attr_temp_max);
- device_create_file(&new_client->dev, &dev_attr_temp_hyst);
+ device_create_file(&new_client->dev, &dev_attr_temp_input1);
+ device_create_file(&new_client->dev, &dev_attr_temp_max1);
+ device_create_file(&new_client->dev, &dev_attr_temp_hyst1);
device_create_file(&new_client->dev, &dev_attr_fan_input1);
device_create_file(&new_client->dev, &dev_attr_fan_min1);
device_create_file(&new_client->dev, &dev_attr_fan_div1);

2004-01-27 23:39:08

by Greg KH

[permalink] [raw]
Subject: Re: [PATCH] i2c driver fixes for 2.6.2-rc2

ChangeSet 1.1474.148.4, 2004/01/26 16:58:46-08:00, [email protected]

[PATCH] I2C: Add ADM1025EB support to i2c-parport

The following patch adds support for the ADM1025 evaluation board to the
i2c-parport (and i2c-parport-light) driver(s). In fact, it happens that
it was already supported as an ADM1032 evaluation board, so it is just a
matter of documenting it correctly.


drivers/i2c/busses/i2c-parport.h | 7 ++++---
1 files changed, 4 insertions(+), 3 deletions(-)


diff -Nru a/drivers/i2c/busses/i2c-parport.h b/drivers/i2c/busses/i2c-parport.h
--- a/drivers/i2c/busses/i2c-parport.h Tue Jan 27 15:26:57 2004
+++ b/drivers/i2c/busses/i2c-parport.h Tue Jan 27 15:26:57 2004
@@ -67,12 +67,13 @@
.getsda = { 0x40, STAT, 1 },
.getscl = { 0x08, STAT, 1 },
},
- /* type 4: ADM 1032 evaluation board */
+ /* type 4: ADM1025 and ADM1032 evaluation boards */
{
.setsda = { 0x02, DATA, 1 },
.setscl = { 0x01, DATA, 1 },
.getsda = { 0x10, STAT, 1 },
- .init = { 0xf0, DATA, 0 },
+ .init = { 0xf0, DATA, 0 }, /* ADM1025 doesn't need this,
+ but it doesn't hurt */
},
};

@@ -84,4 +85,4 @@
" 1 = home brew teletext adapter\n"
" 2 = Velleman K8000 adapter\n"
" 3 = ELV adapter\n"
- " 4 = ADM 1032 evalulation board\n");
+ " 4 = ADM1025 and ADM1032 evaluation boards\n");

2004-01-27 23:39:10

by Greg KH

[permalink] [raw]
Subject: Re: [PATCH] i2c driver fixes for 2.6.2-rc2

ChangeSet 1.1474.148.2, 2004/01/23 17:14:38-08:00, [email protected]

[PATCH] I2C: undo documentation change

Undo a recent change to the i2c documentation. The change belongs to
2.7.


Documentation/i2c/porting-clients | 5 +----
1 files changed, 1 insertion(+), 4 deletions(-)


diff -Nru a/Documentation/i2c/porting-clients b/Documentation/i2c/porting-clients
--- a/Documentation/i2c/porting-clients Tue Jan 27 15:27:19 2004
+++ b/Documentation/i2c/porting-clients Tue Jan 27 15:27:19 2004
@@ -92,10 +92,7 @@
i2c_get_clientdata(client) instead.

* [Interface] Init function should not print anything. Make sure
- there is a MODULE_LICENSE() line. MODULE_PARM() is replaced
- by module_param(). Note that module_param has a third parameter,
- that you should set to 0 by default. See include/linux/moduleparam.h
- for details.
+ there is a MODULE_LICENSE() line.

Coding policy:


2004-01-28 13:08:41

by David Martínez Moreno

[permalink] [raw]
Subject: Typo (Re: [PATCH] i2c driver fixes for 2.6.2-rc2)

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

El Mi?rcoles, 28 de Enero de 2004 00:34, Greg KH escribi?:
> + dev_err(&adapter->dev, "Unrecgonized version/stepping 0x%02x"
> + " Defaulting to LM85.\n", verstep);

Hello, Greg.

Just noticed, please s,recgonized,recognized,g all over the file.

Thanks,


Ender.
- --
Oh, I saw...Very American. Fire enough bullets and hope
they hit the target!
-- Allan Quatermain (The League of Extraordinary Gentlemen)
- --
Servicios de red - Network services
RedIRIS - Spanish Academic Network for Research and Development
Madrid (Spain)
Tlf (+34) 91.585.51.50
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.2.3 (GNU/Linux)

iD8DBQFAF7RSWs/EhA1iABsRAhEvAJ9lEYqh0EkDsDqH12qEcWNRNrUJbACg6zdm
O+T6J0IG3C98iwMhZjh3p8c=
=jtJ1
-----END PGP SIGNATURE-----

2004-01-28 23:28:43

by Greg KH

[permalink] [raw]
Subject: Re: Typo (Re: [PATCH] i2c driver fixes for 2.6.2-rc2)

On Wed, Jan 28, 2004 at 02:08:34PM +0100, David Mart?nez Moreno wrote:
> El Mi?rcoles, 28 de Enero de 2004 00:34, Greg KH escribi?:
> > + dev_err(&adapter->dev, "Unrecgonized version/stepping 0x%02x"
> > + " Defaulting to LM85.\n", verstep);
>
> Hello, Greg.
>
> Just noticed, please s,recgonized,recognized,g all over the file.

Care to send me a spelling fix patch?

thanks,

greg k-h

2004-01-29 00:44:07

by J.A. Magallon

[permalink] [raw]
Subject: Re: [BK PATCH] i2c driver fixes for 2.6.2-rc2


On 2004.01.28, Greg KH wrote:
> Hi,
>
> Here are some i2c driver fixes for 2.6.2-rc2. It's all a bit of small
> bugfixes and documentation updates.
>

After upgrading to sensors 2.8.3 (first I compiled it, then installed the
Makdrake package when appeared), my temperatures are still mutiplied by 10.
I use 2.6.2-rc2-mm1.

Any ideas ?

--
J.A. Magallon <jamagallon()able!es> \ Software is like sex:
werewolf!able!es \ It's better when it's free
Mandrake Linux release 10.0 (Cooker) for i586
Linux 2.6.2-rc2-jam1 (gcc 3.3.2 (Mandrake Linux 10.0 3.3.2-4mdk))

2004-01-29 00:48:18

by J.A. Magallon

[permalink] [raw]
Subject: Re: [BK PATCH] i2c driver fixes for 2.6.2-rc2


On 2004.01.29, J.A. Magallon wrote:
>
> On 2004.01.28, Greg KH wrote:
> > Hi,
> >
> > Here are some i2c driver fixes for 2.6.2-rc2. It's all a bit of small
> > bugfixes and documentation updates.
> >
>
> After upgrading to sensors 2.8.3 (first I compiled it, then installed the
> Makdrake package when appeared), my temperatures are still mutiplied by 10.
> I use 2.6.2-rc2-mm1.
>

Sample output:

werewolf:~# sensors
w83781d-isa-0290
Adapter: ISA adapter
Algorithm: ISA algorithm
VCore 1: +1.98 V (min = +1.90 V, max = +2.10 V)
VCore 2: +2.00 V (min = +1.90 V, max = +2.10 V)
+3.3V: +3.18 V (min = +3.14 V, max = +3.46 V)
+5V: +4.97 V (min = +4.73 V, max = +5.24 V)
+12V: +12.04 V (min = +11.37 V, max = +12.59 V)
-12V: -12.35 V (min = -12.57 V, max = -11.35 V) ALARM
-5V: -4.98 V (min = -5.25 V, max = -4.74 V) ALARM
CPU0 Fan: 4530 RPM (min = 84375 RPM, div = 2) ALARM
CPU1 Fan: 4440 RPM (min = -1 RPM, div = 2) ALARM
CPU0 Tmp: +380?C (high = +0?C, hyst = +640?C) ALARM
CPU1 Tmp: +405.0?C (high = +800?C, hyst = +750?C)
vid: +2.000 V


--
J.A. Magallon <jamagallon()able!es> \ Software is like sex:
werewolf!able!es \ It's better when it's free
Mandrake Linux release 10.0 (Cooker) for i586
Linux 2.6.2-rc2-jam1 (gcc 3.3.2 (Mandrake Linux 10.0 3.3.2-4mdk))

2004-01-29 08:45:30

by Jean Delvare

[permalink] [raw]
Subject: Re: [BK PATCH] i2c driver fixes for 2.6.2-rc2

Quoting "J.A. Magallon" <[email protected]>:

> After upgrading to sensors 2.8.3 (first I compiled it, then installed
> the Makdrake package when appeared), my temperatures are still
> mutiplied by 10. I use 2.6.2-rc2-mm1.
>
> Any ideas ?

As stated on our kernel 2.6 dedicated page [1]: You need lm_sensors CVS
for kernels 2.6.2-rc1 and later.

We plan to release lm_sensors 2.8.4 as soon as Linux 2.6.2 final is
there.

[1] http://secure.netroedge.com/~lm78/kernel26.html

--
Jean Delvare
http://www.ensicaen.ismra.fr/~delvare/

2004-01-29 11:27:23

by David Martínez Moreno

[permalink] [raw]
Subject: Re: Typo (Re: [PATCH] i2c driver fixes for 2.6.2-rc2)

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

El Jueves, 29 de Enero de 2004 00:23, Greg KH escribi?:
> On Wed, Jan 28, 2004 at 02:08:34PM +0100, David Mart?nez Moreno wrote:
> > El Mi?rcoles, 28 de Enero de 2004 00:34, Greg KH escribi?:
> > > + dev_err(&adapter->dev, "Unrecgonized version/stepping 0x%02x"
> > > + " Defaulting to LM85.\n", verstep);
> >
> > Hello, Greg.
> >
> > Just noticed, please s,recgonized,recognized,g all over the file.
>
> Care to send me a spelling fix patch?

Sure, it's only a small thing in return for all that Linux has given to me.

Following patch fixes two typos and a missing full stop. Applies cleanly
against 2.6.2-rc2 + i2c patches you just submitted.

- --- kernel-2.6.x/drivers/i2c/chips/lm85.c.orig 2004-01-29 12:18:49.000000000 +0100
+++ kernel-2.6.x/drivers/i2c/chips/lm85.c 2004-01-29 12:21:01.000000000 +0100
@@ -816,7 +816,7 @@
kind = lm85b ;
} else if( company == LM85_COMPANY_NATIONAL
&& (verstep & 0xf0) == LM85_VERSTEP_GENERIC ) {
- - dev_err(&adapter->dev, "Unrecgonized version/stepping 0x%02x"
+ dev_err(&adapter->dev, "Unrecognized version/stepping 0x%02x"
" Defaulting to LM85.\n", verstep);
kind = any_chip ;
} else if( company == LM85_COMPANY_ANALOG_DEV
@@ -827,7 +827,7 @@
kind = adt7463 ;
} else if( company == LM85_COMPANY_ANALOG_DEV
&& (verstep & 0xf0) == LM85_VERSTEP_GENERIC ) {
- - dev_err(&adapter->dev, "Unrecgonized version/stepping 0x%02x"
+ dev_err(&adapter->dev, "Unrecognized version/stepping 0x%02x"
" Defaulting to ADM1027.\n", verstep);
kind = adm1027 ;
} else if( kind == 0 && (verstep & 0xf0) == 0x60) {
@@ -1204,7 +1204,7 @@

/* Thanks to Richard Barrington for adding the LM85 to sensors-detect.
* Thanks to Margit Schubert-While <[email protected]> for help with
- - * post 2.7.0 CVS changes
+ * post 2.7.0 CVS changes.
*/
MODULE_LICENSE("GPL");
MODULE_AUTHOR("Philip Pokorny <[email protected]>, Margit Schubert-While <[email protected]>");

- --
Non. Je suis la belette de personne.
-- Am?lie (Le fabuleux destin d'Am?lie Poulain)
- --
Servicios de red - Network services
RedIRIS - Spanish Academic Network for Research and Development
Madrid (Spain)
Tlf (+34) 91.585.51.50
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.2.3 (GNU/Linux)

iD8DBQFAGO4TWs/EhA1iABsRAp19AKDVl5+vuHOh3m0f0GamlAKn/6pdTwCg1IMF
dsbE2UzjeJ2YfB+bk5Cu1GE=
=Dapv
-----END PGP SIGNATURE-----

2004-01-29 19:47:19

by Greg KH

[permalink] [raw]
Subject: Re: Typo (Re: [PATCH] i2c driver fixes for 2.6.2-rc2)

On Thu, Jan 29, 2004 at 12:27:15PM +0100, David Mart?nez Moreno wrote:
> -----BEGIN PGP SIGNED MESSAGE-----
> Hash: SHA1
>
> El Jueves, 29 de Enero de 2004 00:23, Greg KH escribi?:
> > On Wed, Jan 28, 2004 at 02:08:34PM +0100, David Mart?nez Moreno wrote:
> > > El Mi?rcoles, 28 de Enero de 2004 00:34, Greg KH escribi?:
> > > > + dev_err(&adapter->dev, "Unrecgonized version/stepping 0x%02x"
> > > > + " Defaulting to LM85.\n", verstep);
> > >
> > > Hello, Greg.
> > >
> > > Just noticed, please s,recgonized,recognized,g all over the file.
> >
> > Care to send me a spelling fix patch?
>
> Sure, it's only a small thing in return for all that Linux has given to me.
>
> Following patch fixes two typos and a missing full stop. Applies cleanly
> against 2.6.2-rc2 + i2c patches you just submitted.

Hm, your mailer munged the patch (due to the PGP signature), care to
redo it so that it can be applied?

thanks,

greg k-h

2004-01-29 22:21:40

by J.A. Magallon

[permalink] [raw]
Subject: Re: [BK PATCH] i2c driver fixes for 2.6.2-rc2


On 2004.01.29, Jean Delvare wrote:
> Quoting "J.A. Magallon" <[email protected]>:
>
> > After upgrading to sensors 2.8.3 (first I compiled it, then installed
> > the Makdrake package when appeared), my temperatures are still
> > mutiplied by 10. I use 2.6.2-rc2-mm1.
> >
> > Any ideas ?
>
> As stated on our kernel 2.6 dedicated page [1]: You need lm_sensors CVS
> for kernels 2.6.2-rc1 and later.
>
> We plan to release lm_sensors 2.8.4 as soon as Linux 2.6.2 final is
> there.
>
> [1] http://secure.netroedge.com/~lm78/kernel26.html
>

Thanks, I dled the cvs version and my redings look normal now:

werewolf:~# sensors
w83781d-isa-0290
Adapter: ISA adapter
VCore 1: +1.97 V (min = +1.90 V, max = +2.10 V)
VCore 2: +2.02 V (min = +1.90 V, max = +2.10 V)
+3.3V: +3.23 V (min = +3.14 V, max = +3.46 V)
+5V: +4.97 V (min = +4.73 V, max = +5.24 V)
+12V: +12.04 V (min = +11.37 V, max = +12.59 V)
-12V: -12.18 V (min = -12.57 V, max = -11.35 V) ALARM
-5V: -4.96 V (min = -5.25 V, max = -4.74 V) ALARM
CPU0 Fan: 4470 RPM (min = 84375 RPM, div = 2) ALARM
CPU1 Fan: 4470 RPM (min = -1 RPM, div = 2) ALARM
CPU0 Tmp: +41?C (high = +0?C, hyst = +64?C) ALARM
CPU1 Tmp: +44.5?C (high = +80?C, hyst = +75?C)
vid: +2.000 V

One question: is there any reference of what do temperature sensors
measure exactly ? IE, I have a dual PII box, that temperatures are
for both processors, one processor and the mobo, two sensors on
different points in the mobo, ??

TIA

--
J.A. Magallon <jamagallon()able!es> \ Software is like sex:
werewolf!able!es \ It's better when it's free
Mandrake Linux release 10.0 (Cooker) for i586
Linux 2.6.2-rc2-jam1 (gcc 3.3.2 (Mandrake Linux 10.0 3.3.2-4mdk))

2004-01-29 22:57:32

by J.A. Magallon

[permalink] [raw]
Subject: Re: [BK PATCH] i2c driver fixes for 2.6.2-rc2


On 2004.01.29, J.A. Magallon wrote:
>
> On 2004.01.29, Jean Delvare wrote:
> > Quoting "J.A. Magallon" <[email protected]>:
> >
> > > After upgrading to sensors 2.8.3 (first I compiled it, then installed
> > > the Makdrake package when appeared), my temperatures are still
> > > mutiplied by 10. I use 2.6.2-rc2-mm1.
> > >
> > > Any ideas ?
> >
> > As stated on our kernel 2.6 dedicated page [1]: You need lm_sensors CVS
> > for kernels 2.6.2-rc1 and later.
> >
> > We plan to release lm_sensors 2.8.4 as soon as Linux 2.6.2 final is
> > there.
> >
> > [1] http://secure.netroedge.com/~lm78/kernel26.html
> >
>
> Thanks, I dled the cvs version and my redings look normal now:
>
> werewolf:~# sensors
> w83781d-isa-0290
> Adapter: ISA adapter
> VCore 1: +1.97 V (min = +1.90 V, max = +2.10 V)
> VCore 2: +2.02 V (min = +1.90 V, max = +2.10 V)
> +3.3V: +3.23 V (min = +3.14 V, max = +3.46 V)
> +5V: +4.97 V (min = +4.73 V, max = +5.24 V)
> +12V: +12.04 V (min = +11.37 V, max = +12.59 V)

Oops, not so good:

> -12V: -12.18 V (min = -12.57 V, max = -11.35 V) ALARM
> -5V: -4.96 V (min = -5.25 V, max = -4.74 V) ALARM

Why ALARM ?

TIA


--
J.A. Magallon <jamagallon()able!es> \ Software is like sex:
werewolf!able!es \ It's better when it's free
Mandrake Linux release 10.0 (Cooker) for i586
Linux 2.6.2-rc2-jam1 (gcc 3.3.2 (Mandrake Linux 10.0 3.3.2-4mdk))

2004-01-30 03:38:59

by Mark M. Hoffman

[permalink] [raw]
Subject: Re: [BK PATCH] i2c driver fixes for 2.6.2-rc2

* J.A. Magallon <[email protected]> [2004-01-29 23:56:59 +0100]:
>
> On 2004.01.29, J.A. Magallon wrote:
> >
> > werewolf:~# sensors
> > w83781d-isa-0290
> > Adapter: ISA adapter
> > VCore 1: +1.97 V (min = +1.90 V, max = +2.10 V)
> > VCore 2: +2.02 V (min = +1.90 V, max = +2.10 V)
> > +3.3V: +3.23 V (min = +3.14 V, max = +3.46 V)
> > +5V: +4.97 V (min = +4.73 V, max = +5.24 V)
> > +12V: +12.04 V (min = +11.37 V, max = +12.59 V)
>
> Oops, not so good:
>
> > -12V: -12.18 V (min = -12.57 V, max = -11.35 V) ALARM
> > -5V: -4.96 V (min = -5.25 V, max = -4.74 V) ALARM
>
> Why ALARM ?

The alarm indicator is "sticky". Even though the present
readings are within limits, the alarm says that the voltage
moved outside its limit since the last time you ran sensors.

Trying running sensors 5 times, at 2 second intervals. If
the voltage always stays within the limits but the alarm
is not cleared, then maybe there is a problem with the
driver. If that's the case, please follow up on the sensors
mailing list.

Regards,

--
Mark M. Hoffman
[email protected]

2004-01-30 09:19:48

by Jean Delvare

[permalink] [raw]
Subject: Re: [BK PATCH] i2c driver fixes for 2.6.2-rc2

Quoting "J.A. Magallon" <[email protected]>:

> w83781d-isa-0290
> (...)
> CPU0 Tmp: +41?C (high = +0?C, hyst = +64?C) ALARM
> CPU1 Tmp: +44.5?C (high = +80?C, hyst = +75?C)
> (...)
> One question: is there any reference of what do temperature sensors
> measure exactly ? IE, I have a dual PII box, that temperatures are
> for both processors, one processor and the mobo, two sensors on
> different points in the mobo, ??

On the w83781d (and this is true for most similar chips), temp1 is the
chipset's own temperature, and temp2 and temp3 are remote temperatures.
What these remote sensors are configured to measure depends on your
motherboard. On a dual CPU system, I'd expect them to handle one CPU
each. If I am right, they you will want to edit /etc/sensors.conf for
proper labels and remove the "ignore temp3" statement that must be
there.

--
Jean Delvare
http://www.ensicaen.ismra.fr/~delvare/

2004-01-30 09:37:43

by Jean Delvare

[permalink] [raw]
Subject: Re: [BK PATCH] i2c driver fixes for 2.6.2-rc2

Quoting "Mark M. Hoffman" <[email protected]>:

> * J.A. Magallon <[email protected]> [2004-01-29 23:56:59 +0100]:
>
> > Oops, not so good:
> >
> > > -12V: -12.18 V (min = -12.57 V, max = -11.35 V) ALARM
> > > -5V: -4.96 V (min = -5.25 V, max = -4.74 V) ALARM
> >
> > Why ALARM ?
>
> The alarm indicator is "sticky". Even though the present
> readings are within limits, the alarm says that the voltage
> moved outside its limit since the last time you ran sensors.
>
> Trying running sensors 5 times, at 2 second intervals. If
> the voltage always stays within the limits but the alarm
> is not cleared, then maybe there is a problem with the
> driver. If that's the case, please follow up on the sensors
> mailing list.

What Mark says is perfectly true as a generic remark, but this isn't the
problem here. The problem is that the limits of negative voltages are
swapped. Internally, the low limit is the one nearer from 0, i.e. the
lesser in absolute value. Your output shows the contrary.

This is a bug in the driver, or libsensors, or both. We have to take a
look at this really soon. This is on my to-do list for some times
already, just gimme some more time.

A temporary way to workaround the problem is to swap the limits in
/etc/sensors.conf, but this will cause problems if you are using 2.4
and 2.6 kernels on the same system, because the bug shows only in 2.6.

--
Jean Delvare
http://www.ensicaen.ismra.fr/~delvare/

2004-01-30 09:58:39

by David Martínez Moreno

[permalink] [raw]
Subject: Re: Typo (Re: [PATCH] i2c driver fixes for 2.6.2-rc2)

El Jueves, 29 de Enero de 2004 20:47, Greg KH escribi?:
> On Thu, Jan 29, 2004 at 12:27:15PM +0100, David Mart?nez Moreno wrote:
> > Sure, it's only a small thing in return for all that Linux has given to
> > me.
> >
> > Following patch fixes two typos and a missing full stop. Applies cleanly
> > against 2.6.2-rc2 + i2c patches you just submitted.
>
> Hm, your mailer munged the patch (due to the PGP signature), care to
> redo it so that it can be applied?

I agree. :-)

There goes again, without GPG sig.

Following patch fixes two typos and a missing full stop. Applies cleanly
against 2.6.2-rc2 + i2c patches you just submitted.

--- kernel-2.6.x/drivers/i2c/chips/lm85.c.orig 2004-01-29 12:18:49.000000000 +0100
+++ kernel-2.6.x/drivers/i2c/chips/lm85.c 2004-01-29 12:21:01.000000000 +0100
@@ -816,7 +816,7 @@
kind = lm85b ;
} else if( company == LM85_COMPANY_NATIONAL
&& (verstep & 0xf0) == LM85_VERSTEP_GENERIC ) {
- dev_err(&adapter->dev, "Unrecgonized version/stepping 0x%02x"
+ dev_err(&adapter->dev, "Unrecognized version/stepping 0x%02x"
" Defaulting to LM85.\n", verstep);
kind = any_chip ;
} else if( company == LM85_COMPANY_ANALOG_DEV
@@ -827,7 +827,7 @@
kind = adt7463 ;
} else if( company == LM85_COMPANY_ANALOG_DEV
&& (verstep & 0xf0) == LM85_VERSTEP_GENERIC ) {
- dev_err(&adapter->dev, "Unrecgonized version/stepping 0x%02x"
+ dev_err(&adapter->dev, "Unrecognized version/stepping 0x%02x"
" Defaulting to ADM1027.\n", verstep);
kind = adm1027 ;
} else if( kind == 0 && (verstep & 0xf0) == 0x60) {
@@ -1204,7 +1204,7 @@

/* Thanks to Richard Barrington for adding the LM85 to sensors-detect.
* Thanks to Margit Schubert-While <[email protected]> for help with
- * post 2.7.0 CVS changes
+ * post 2.7.0 CVS changes.
*/
MODULE_LICENSE("GPL");
MODULE_AUTHOR("Philip Pokorny <[email protected]>, Margit Schubert-While <[email protected]>");


Regards,


Ender.
--
Oh, I saw...Very American. Fire enough bullets and hope
they hit the target!
-- Allan Quatermain (The League of Extraordinary Gentlemen)
--
Servicios de red - Network services
RedIRIS - Spanish Academic Network for Research and Development
Madrid (Spain)
Tlf (+34) 91.585.51.50

2004-01-31 00:55:29

by Greg KH

[permalink] [raw]
Subject: Re: Typo (Re: [PATCH] i2c driver fixes for 2.6.2-rc2)

On Fri, Jan 30, 2004 at 10:58:29AM +0100, David Mart?nez Moreno wrote:
> El Jueves, 29 de Enero de 2004 20:47, Greg KH escribi?:
> > On Thu, Jan 29, 2004 at 12:27:15PM +0100, David Mart?nez Moreno wrote:
> > > Sure, it's only a small thing in return for all that Linux has given to
> > > me.
> > >
> > > Following patch fixes two typos and a missing full stop. Applies cleanly
> > > against 2.6.2-rc2 + i2c patches you just submitted.
> >
> > Hm, your mailer munged the patch (due to the PGP signature), care to
> > redo it so that it can be applied?
>
> I agree. :-)
>
> There goes again, without GPG sig.

Much nicer.

> Following patch fixes two typos and a missing full stop. Applies cleanly
> against 2.6.2-rc2 + i2c patches you just submitted.

Thanks, I've applied this to my trees.

greg k-h