Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

Merge branch 'i2c/for-current' of git://git.kernel.org/pub/scm/linux/kernel/git/wsa/linux

Pull i2c bugfixes from Wolfram Sang:
"Two bugfixes (proper IO mapping and use of mutex) for a driver feature
we introduced in this cycle"

* 'i2c/for-current' of git://git.kernel.org/pub/scm/linux/kernel/git/wsa/linux:
i2c: piix4: Request the SMBUS semaphore inside the mutex
i2c: piix4: Fix request_region size

+8 -6
+8 -6
drivers/i2c/busses/i2c-piix4.c
··· 58 58 #define SMBSLVDAT (0xC + piix4_smba) 59 59 60 60 /* count for request_region */ 61 - #define SMBIOSIZE 8 61 + #define SMBIOSIZE 9 62 62 63 63 /* PCI Address Constants */ 64 64 #define SMBBA 0x090 ··· 592 592 u8 port; 593 593 int retval; 594 594 595 + mutex_lock(&piix4_mutex_sb800); 596 + 595 597 /* Request the SMBUS semaphore, avoid conflicts with the IMC */ 596 598 smbslvcnt = inb_p(SMBSLVCNT); 597 599 do { ··· 607 605 usleep_range(1000, 2000); 608 606 } while (--retries); 609 607 /* SMBus is still owned by the IMC, we give up */ 610 - if (!retries) 608 + if (!retries) { 609 + mutex_unlock(&piix4_mutex_sb800); 611 610 return -EBUSY; 612 - 613 - mutex_lock(&piix4_mutex_sb800); 611 + } 614 612 615 613 outb_p(piix4_port_sel_sb800, SB800_PIIX4_SMB_IDX); 616 614 smba_en_lo = inb_p(SB800_PIIX4_SMB_IDX + 1); ··· 625 623 626 624 outb_p(smba_en_lo, SB800_PIIX4_SMB_IDX + 1); 627 625 628 - mutex_unlock(&piix4_mutex_sb800); 629 - 630 626 /* Release the semaphore */ 631 627 outb_p(smbslvcnt | 0x20, SMBSLVCNT); 628 + 629 + mutex_unlock(&piix4_mutex_sb800); 632 630 633 631 return retval; 634 632 }