Remove double inclusion of linux/capability.h

2007-08-20 Thread Linux Kernel Mailing List
Gitweb: 
http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=e598fbaabdb6608915cbc5e80409d70f4f857e5c
Commit: e598fbaabdb6608915cbc5e80409d70f4f857e5c
Parent: 2a67789618abb74f0f97d4836a2b937bff2f1b2d
Author: Christian Heim [EMAIL PROTECTED]
AuthorDate: Sun Aug 19 13:07:59 2007 +0200
Committer:  Linus Torvalds [EMAIL PROTECTED]
CommitDate: Sun Aug 19 10:12:32 2007 -0700

Remove double inclusion of linux/capability.h

Remove the second inclusion of linux/capability.h, which has been
introduced with [PATCH] move capable() to capability.h (commit
c59ede7b78db329949d9cdcd7064e22d357560ef)

Signed-off-by: Christian Heim [EMAIL PROTECTED]
Signed-off-by: Linus Torvalds [EMAIL PROTECTED]
---
 kernel/sysctl.c |1 -
 1 files changed, 0 insertions(+), 1 deletions(-)

diff --git a/kernel/sysctl.c b/kernel/sysctl.c
index 8bdb8c0..9029690 100644
--- a/kernel/sysctl.c
+++ b/kernel/sysctl.c
@@ -27,7 +27,6 @@
 #include linux/capability.h
 #include linux/ctype.h
 #include linux/utsname.h
-#include linux/capability.h
 #include linux/smp_lock.h
 #include linux/fs.h
 #include linux/init.h
-
To unsubscribe from this list: send the line unsubscribe git-commits-head in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html


KVM: Avoid calling smp_call_function_single() with interrupts disabled

2007-08-20 Thread Linux Kernel Mailing List
Gitweb: 
http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=6ec8a856e4097d42ece9b0b9459bbca1586f13d7
Commit: 6ec8a856e4097d42ece9b0b9459bbca1586f13d7
Parent: e598fbaabdb6608915cbc5e80409d70f4f857e5c
Author: Avi Kivity [EMAIL PROTECTED]
AuthorDate: Sun Aug 19 15:57:26 2007 +0300
Committer:  Linus Torvalds [EMAIL PROTECTED]
CommitDate: Sun Aug 19 10:13:49 2007 -0700

KVM: Avoid calling smp_call_function_single() with interrupts disabled

When taking a cpu down, we need to hardware_disable() it.
Unfortunately, the CPU_DYING notifier is called with interrupts
disabled, which means we can't use smp_call_function_single().

Fortunately, the CPU_DYING notifier is always called on the dying cpu,
so we don't need to use the function at all and can simply call
hardware_disable() directly.

Tested-by: Paolo Ornati [EMAIL PROTECTED]
Signed-off-by: Avi Kivity [EMAIL PROTECTED]
Signed-off-by: Linus Torvalds [EMAIL PROTECTED]
---
 drivers/kvm/kvm_main.c |4 
 1 files changed, 4 insertions(+), 0 deletions(-)

diff --git a/drivers/kvm/kvm_main.c b/drivers/kvm/kvm_main.c
index 9685609..cd05579 100644
--- a/drivers/kvm/kvm_main.c
+++ b/drivers/kvm/kvm_main.c
@@ -2974,6 +2974,10 @@ static int kvm_cpu_hotplug(struct notifier_block 
*notifier, unsigned long val,
switch (val) {
case CPU_DYING:
case CPU_DYING_FROZEN:
+   printk(KERN_INFO kvm: disabling virtualization on CPU%d\n,
+  cpu);
+   hardware_disable(NULL);
+   break;
case CPU_UP_CANCELED:
case CPU_UP_CANCELED_FROZEN:
printk(KERN_INFO kvm: disabling virtualization on CPU%d\n,
-
To unsubscribe from this list: send the line unsubscribe git-commits-head in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html


missing return in bridge sysfs code

2007-08-20 Thread Linux Kernel Mailing List
Gitweb: 
http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=35b426c329e12e33bd0f0912f3d2e3f5f7b2c486
Commit: 35b426c329e12e33bd0f0912f3d2e3f5f7b2c486
Parent: 6ec8a856e4097d42ece9b0b9459bbca1586f13d7
Author: Al Viro [EMAIL PROTECTED]
AuthorDate: Sun Aug 19 04:51:26 2007 +0100
Committer:  Linus Torvalds [EMAIL PROTECTED]
CommitDate: Sun Aug 19 10:32:31 2007 -0700

missing return in bridge sysfs code

Signed-off-by: Al Viro [EMAIL PROTECTED]
Acked-by: David S. Miller [EMAIL PROTECTED]
Signed-off-by: Linus Torvalds [EMAIL PROTECTED]
---
 net/bridge/br_sysfs_br.c |1 +
 1 files changed, 1 insertions(+), 0 deletions(-)

diff --git a/net/bridge/br_sysfs_br.c b/net/bridge/br_sysfs_br.c
index 88f4300..c65f54e 100644
--- a/net/bridge/br_sysfs_br.c
+++ b/net/bridge/br_sysfs_br.c
@@ -167,6 +167,7 @@ static ssize_t store_stp_state(struct device *d,
br_stp_set_enabled(br, val);
rtnl_unlock();
 
+   return len;
 }
 static DEVICE_ATTR(stp_state, S_IRUGO | S_IWUSR, show_stp_state,
   store_stp_state);
-
To unsubscribe from this list: send the line unsubscribe git-commits-head in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html


ensure we don't use bootconsoles after init has been released

2007-08-20 Thread Linux Kernel Mailing List
Gitweb: 
http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=0c5564bd91ad237212871d52deaf79ffe06bcc64
Commit: 0c5564bd91ad237212871d52deaf79ffe06bcc64
Parent: 35b426c329e12e33bd0f0912f3d2e3f5f7b2c486
Author: Robin Getz [EMAIL PROTECTED]
AuthorDate: Mon Aug 20 15:22:47 2007 -0400
Committer:  Linus Torvalds [EMAIL PROTECTED]
CommitDate: Mon Aug 20 22:42:01 2007 -0700

ensure we don't use bootconsoles after init has been released

This is a followup to the cleanups for earlyprintk patch from Gerd Hoffmann


http://git.kernel.org/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=69331af79cf29e26d1231152a172a1a10c2df511

This ensures that a bootconsole is unregistered if it is not replaced.
The current implementation spews garbage out the bootconsole in this case,
since the bootconsole structure is normally in the init section, and is
freed, but still used.

Signed-off-by: Robin Getz [EMAIL PROTECTED]
Acked-by: Gerd Hoffmann [EMAIL PROTECTED]
Acked-by: Paul Mundt [EMAIL PROTECTED]
Cc: Mike Frysinger [EMAIL PROTECTED]
Signed-off-by: Linus Torvalds [EMAIL PROTECTED]
---
 kernel/printk.c |   11 +++
 1 files changed, 11 insertions(+), 0 deletions(-)

diff --git a/kernel/printk.c b/kernel/printk.c
index bd2cd06..5c7c325 100644
--- a/kernel/printk.c
+++ b/kernel/printk.c
@@ -1083,6 +1083,17 @@ int unregister_console(struct console *console)
 }
 EXPORT_SYMBOL(unregister_console);
 
+static int __init disable_boot_consoles(void)
+{
+   if (console_drivers-flags  CON_BOOT) {
+   printk(KERN_INFO turn off boot console %s%d\n,
+   console_drivers-name, console_drivers-index);
+   return unregister_console(console_drivers);
+   }
+   return 0;
+}
+late_initcall(disable_boot_consoles);
+
 /**
  * tty_write_message - write a message to a certain tty, not just the console.
  * @tty: the destination tty_struct
-
To unsubscribe from this list: send the line unsubscribe git-commits-head in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[POWERPC] Add interrupt resource for RTC CMOS driver

2007-08-20 Thread Linux Kernel Mailing List
Gitweb: 
http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=ada3ea6fcde45abc55e2af0e564455fd7f943a79
Commit: ada3ea6fcde45abc55e2af0e564455fd7f943a79
Parent: 28e8351ac22de25034e048c680014ad824323c65
Author: Kumar Gala [EMAIL PROTECTED]
AuthorDate: Thu Aug 16 23:44:00 2007 -0500
Committer:  Kumar Gala [EMAIL PROTECTED]
CommitDate: Fri Aug 17 13:18:58 2007 -0500

[POWERPC] Add interrupt resource for RTC CMOS driver

The RTC CMOS driver expects the interrupt to be a resource of the platform
device.  Use a fixed interrupt value of 8 since on PPC if we are using this
its off an i8259 which we ensure has interrupt numbers 0..15.

Signed-off-by: Kumar Gala [EMAIL PROTECTED]
---
 arch/powerpc/sysdev/rtc_cmos_setup.c |   17 +
 1 files changed, 13 insertions(+), 4 deletions(-)

diff --git a/arch/powerpc/sysdev/rtc_cmos_setup.c 
b/arch/powerpc/sysdev/rtc_cmos_setup.c
index e276048..0c9ac7e 100644
--- a/arch/powerpc/sysdev/rtc_cmos_setup.c
+++ b/arch/powerpc/sysdev/rtc_cmos_setup.c
@@ -20,14 +20,16 @@ static int  __init add_rtc(void)
 {
struct device_node *np;
struct platform_device *pd;
-   struct resource res;
+   struct resource res[2];
int ret;
 
+   memset(res, 0, sizeof(res));
+
np = of_find_compatible_node(NULL, NULL, pnpPNP,b00);
if (!np)
return -ENODEV;
 
-   ret = of_address_to_resource(np, 0, res);
+   ret = of_address_to_resource(np, 0, res[0]);
of_node_put(np);
if (ret)
return ret;
@@ -36,11 +38,18 @@ static int  __init add_rtc(void)
 * RTC_PORT(x) is hardcoded in asm/mc146818rtc.h.  Verify that the
 * address provided by the device node matches.
 */
-   if (res.start != RTC_PORT(0))
+   if (res[0].start != RTC_PORT(0))
return -EINVAL;
 
+   /* Use a fixed interrupt value of 8 since on PPC if we are using this
+* its off an i8259 which we ensure has interrupt numbers 0..15. */
+   res[1].start = 8;
+   res[1].end = 8;
+   res[1].flags = IORESOURCE_IRQ;
+
pd = platform_device_register_simple(rtc_cmos, -1,
-res, 1);
+res[0], 2);
+
if (IS_ERR(pd))
return PTR_ERR(pd);
 
-
To unsubscribe from this list: send the line unsubscribe git-commits-head in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[POWERPC] Fix interrupt routing and setup of ULI M1575 on FSL boards

2007-08-20 Thread Linux Kernel Mailing List
Gitweb: 
http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=b66510cb9992d204f216049e9c01d432c7635f6c
Commit: b66510cb9992d204f216049e9c01d432c7635f6c
Parent: ada3ea6fcde45abc55e2af0e564455fd7f943a79
Author: Kumar Gala [EMAIL PROTECTED]
AuthorDate: Thu Aug 16 23:55:55 2007 -0500
Committer:  Kumar Gala [EMAIL PROTECTED]
CommitDate: Fri Aug 17 13:22:16 2007 -0500

[POWERPC] Fix interrupt routing and setup of ULI M1575 on FSL boards

The interrupt routing in the device trees for the ULI M1575 was
inproperly using the interrupt line field as pci function.  Fixed
up the device tree's to actual conform for to specification and
changed the interrupt mapping code so it just uses a static mapping
setup as follows:

PIRQA - IRQ9
PIRQB - IRQ10
PIRQC - IRQ11
PIRQD - IRQ12
USB 1.1 OCHI (1c.0) - IRQ12
USB 1.1 OCHI (1c.1) - IRQ9
USB 1.1 OCHI (1c.2) - IRQ10
USB 1.1 ECHI (1c.3) - IRQ11
LAN (1b.0) - IRQ6
AC97 (1d.0) - IRQ6
Modem (1d.1) - IRQ6
HD Audio (1d.2) - IRQ6
SATA (1f.1) - IRQ5
SMB (1e.1) - IRQ7
PMU (1e.2) - IRQ7
PATA (1f.0) - IRQ14/15

Took the oppurtunity to refactor the code into a single file so we
don't have to duplicate these fixes on the two current boards in the
tree and several forth coming boards that will also need the code.

Fixed RTC support that requires a dummy memory read on the P2P bridge
to unlock the RTC and setup the default of the RTC alarm registers to
match with a basic x86 style CMOS RTC.

Moved code that poked ISA registers to a FIXUP_FINAL quirk to ensure
the PCI IO space has been setup properly before we start poking ISA
registers at random locations.

Signed-off-by: Kumar Gala [EMAIL PROTECTED]
---
 arch/powerpc/boot/dts/mpc8544ds.dts|   88 --
 arch/powerpc/boot/dts/mpc8641_hpcn.dts |  114 +++--
 arch/powerpc/platforms/85xx/Kconfig|1 +
 arch/powerpc/platforms/85xx/mpc8544_ds.c   |  214 ++--
 arch/powerpc/platforms/86xx/Kconfig|1 +
 arch/powerpc/platforms/86xx/mpc86xx_hpcn.c |  224 ++---
 arch/powerpc/platforms/Kconfig |8 +
 arch/powerpc/platforms/Makefile|3 +
 arch/powerpc/platforms/fsl_uli1575.c   |  255 
 9 files changed, 363 insertions(+), 545 deletions(-)

diff --git a/arch/powerpc/boot/dts/mpc8544ds.dts 
b/arch/powerpc/boot/dts/mpc8544ds.dts
index 4680e20..3e79bf0 100644
--- a/arch/powerpc/boot/dts/mpc8544ds.dts
+++ b/arch/powerpc/boot/dts/mpc8544ds.dts
@@ -44,8 +44,18 @@
#size-cells = 1;
#interrupt-cells = 2;
device_type = soc;
-   ranges = 0 e000 0010;
-   reg = e000 0010;  // CCSRBAR 1M
+
+
+   ranges = 1000 e0001000 000ff000
+ 8000 8000 2000
+ a000 a000 1000
+ b000 b000 0010
+ c000 c000 2000
+ b010 b010 0010
+ e100 e100 0001
+ e101 e101 0001
+ e102 e102 0001;
+   reg = e000 1000;  // CCSRBAR 1M
bus-frequency = 0;// Filled out by uboot.
 
[EMAIL PROTECTED] {
@@ -161,8 +171,8 @@
interrupt-parent = mpic;
interrupts = 18 2;
bus-range = 0 ff;
-   ranges = 0200 0 8000 8000 0 1000
- 0100 0  e200 0 0080;
+   ranges = 0200 0 c000 c000 0 2000
+ 0100 0  e100 0 0001;
clock-frequency = 3f940aa;
#interrupt-cells = 1;
#size-cells = 2;
@@ -178,8 +188,8 @@
#address-cells = 3;
reg = 9000 1000;
bus-range = 0 ff;
-   ranges = 0200 0 9000 9000 0 1000
- 0100 0  e300 0 0080;
+   ranges = 0200 0 8000 8000 0 2000
+ 0100 0  e101 0 0001;
clock-frequency = 1fca055;
interrupt-parent = mpic;
interrupts = 1a 2;
@@ -202,7 +212,7 @@
reg = a000 1000;
bus-range = 0 ff;
ranges = 0200 0 a000 a000 0 1000
- 0100 0  e280 0 0080;
+  

[POWERPC] Fix FSL BookE machine check reporting

2007-08-20 Thread Linux Kernel Mailing List
Gitweb: 
http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=86d7a9a9c4775f864e6bc5f5da66ef9ea3715734
Commit: 86d7a9a9c4775f864e6bc5f5da66ef9ea3715734
Parent: b66510cb9992d204f216049e9c01d432c7635f6c
Author: Becky Bruce [EMAIL PROTECTED]
AuthorDate: Thu Aug 2 15:37:15 2007 -0500
Committer:  Kumar Gala [EMAIL PROTECTED]
CommitDate: Fri Aug 17 13:22:28 2007 -0500

[POWERPC] Fix FSL BookE machine check reporting

Reserved MCSR bits on FSL BookE parts may have spurious values
when mcheck occurs.  Mask these off when printing the MCSR to
avoid confusion.  Also, get rid of the MCSR_GL_CI bit defined
for e500 - this bit doesn't actually have any meaning.

Signed-off-by: Becky Bruce [EMAIL PROTECTED]
Signed-off-by: Kumar Gala [EMAIL PROTECTED]
---
 arch/powerpc/kernel/traps.c |4 +---
 include/asm-powerpc/reg_booke.h |   12 +++-
 2 files changed, 12 insertions(+), 4 deletions(-)

diff --git a/arch/powerpc/kernel/traps.c b/arch/powerpc/kernel/traps.c
index 2bb1cb9..d8502e3 100644
--- a/arch/powerpc/kernel/traps.c
+++ b/arch/powerpc/kernel/traps.c
@@ -299,7 +299,7 @@ static inline int check_io_access(struct pt_regs *regs)
 #ifndef CONFIG_FSL_BOOKE
 #define get_mc_reason(regs)((regs)-dsisr)
 #else
-#define get_mc_reason(regs)(mfspr(SPRN_MCSR))
+#define get_mc_reason(regs)(mfspr(SPRN_MCSR)  MCSR_MASK)
 #endif
 #define REASON_FP  ESR_FP
 #define REASON_ILLEGAL (ESR_PIL | ESR_PUO)
@@ -414,8 +414,6 @@ void machine_check_exception(struct pt_regs *regs)
printk(Data Cache Push Parity Error\n);
if (reason  MCSR_DCPERR)
printk(Data Cache Parity Error\n);
-   if (reason  MCSR_GL_CI)
-   printk(Guarded Load or Cache-Inhibited stwcx.\n);
if (reason  MCSR_BUS_IAERR)
printk(Bus - Instruction Address Error\n);
if (reason  MCSR_BUS_RAERR)
diff --git a/include/asm-powerpc/reg_booke.h b/include/asm-powerpc/reg_booke.h
index 064405c..8fdc2b4 100644
--- a/include/asm-powerpc/reg_booke.h
+++ b/include/asm-powerpc/reg_booke.h
@@ -223,7 +223,6 @@
 #define MCSR_ICPERR0x4000UL /* I-Cache Parity Error */
 #define MCSR_DCP_PERR  0x2000UL /* D-Cache Push Parity Error */
 #define MCSR_DCPERR0x1000UL /* D-Cache Parity Error */
-#define MCSR_GL_CI 0x0001UL /* Guarded Load or Cache-Inhibited stwcx. 
*/
 #define MCSR_BUS_IAERR 0x0080UL /* Instruction Address Error */
 #define MCSR_BUS_RAERR 0x0040UL /* Read Address Error */
 #define MCSR_BUS_WAERR 0x0020UL /* Write Address Error */
@@ -232,6 +231,12 @@
 #define MCSR_BUS_WBERR 0x0004UL /* Write Data Bus Error */
 #define MCSR_BUS_IPERR 0x0002UL /* Instruction parity Error */
 #define MCSR_BUS_RPERR 0x0001UL /* Read parity Error */
+
+/* e500 parts may set unused bits in MCSR; mask these off */
+#define MCSR_MASK  (MCSR_MCP | MCSR_ICPERR | MCSR_DCP_PERR | \
+   MCSR_DCPERR | MCSR_BUS_IAERR | MCSR_BUS_RAERR | \
+   MCSR_BUS_WAERR | MCSR_BUS_IBERR | MCSR_BUS_RBERR | \
+   MCSR_BUS_WBERR | MCSR_BUS_IPERR | MCSR_BUS_RPERR)
 #endif
 #ifdef CONFIG_E200
 #define MCSR_MCP   0x8000UL /* Machine Check Input Pin */
@@ -243,6 +248,11 @@
 #define MCSR_BUS_DRERR 0x0008UL /* Read Bus Error on data load */
 #define MCSR_BUS_WRERR 0x0004UL /* Write Bus Error on buffered
store or cache line push */
+
+/* e200 parts may set unused bits in MCSR; mask these off */
+#define MCSR_MASK  (MCSR_MCP | MCSR_CP_PERR | MCSR_CPERR | \
+   MCSR_EXCP_ERR | MCSR_BUS_IRERR | MCSR_BUS_DRERR | \
+   MCSR_BUS_WRERR)
 #endif
 
 /* Bit definitions for the DBSR. */
-
To unsubscribe from this list: send the line unsubscribe git-commits-head in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html


V4L/DVB (5968): videodev2.h: remove superfluous FBUF GLOBAL_INV_ALPHA support

2007-08-20 Thread Linux Kernel Mailing List
Gitweb: 
http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=c9b0ee2c2af33c2ca722aa05bbcb604487134e4c
Commit: c9b0ee2c2af33c2ca722aa05bbcb604487134e4c
Parent: 2a67789618abb74f0f97d4836a2b937bff2f1b2d
Author: Hans Verkuil [EMAIL PROTECTED]
AuthorDate: Tue Jul 31 12:42:22 2007 -0300
Committer:  Mauro Carvalho Chehab [EMAIL PROTECTED]
CommitDate: Mon Aug 20 12:18:01 2007 -0300

V4L/DVB (5968): videodev2.h: remove superfluous FBUF GLOBAL_INV_ALPHA 
support

There is no need for a global inverted alpha capability since all the
application has to do is to pass '255-alpha' as the global alpha value.

Signed-off-by: Hans Verkuil [EMAIL PROTECTED]
Signed-off-by: Mauro Carvalho Chehab [EMAIL PROTECTED]
---
 include/linux/videodev2.h |2 --
 1 files changed, 0 insertions(+), 2 deletions(-)

diff --git a/include/linux/videodev2.h b/include/linux/videodev2.h
index c66c8a3..ae9b24c 100644
--- a/include/linux/videodev2.h
+++ b/include/linux/videodev2.h
@@ -617,7 +617,6 @@ struct v4l2_framebuffer
 #define V4L2_FBUF_CAP_LOCAL_ALPHA  0x0010
 #define V4L2_FBUF_CAP_GLOBAL_ALPHA 0x0020
 #define V4L2_FBUF_CAP_LOCAL_INV_ALPHA  0x0040
-#define V4L2_FBUF_CAP_GLOBAL_INV_ALPHA 0x0080
 /*  Flags for the 'flags' field. */
 #define V4L2_FBUF_FLAG_PRIMARY 0x0001
 #define V4L2_FBUF_FLAG_OVERLAY 0x0002
@@ -625,7 +624,6 @@ struct v4l2_framebuffer
 #define V4L2_FBUF_FLAG_LOCAL_ALPHA 0x0008
 #define V4L2_FBUF_FLAG_GLOBAL_ALPHA0x0010
 #define V4L2_FBUF_FLAG_LOCAL_INV_ALPHA 0x0020
-#define V4L2_FBUF_FLAG_GLOBAL_INV_ALPHA0x0040
 
 struct v4l2_clip
 {
-
To unsubscribe from this list: send the line unsubscribe git-commits-head in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html


JFFS2 locking regression fix.

2007-08-20 Thread Linux Kernel Mailing List
Gitweb: 
http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=b5748643332bf75274e0b639926d57e86fb133cf
Commit: b5748643332bf75274e0b639926d57e86fb133cf
Parent: 2046219364a40bcb13482ff68eb6ccec13405633
Author: David Woodhouse [EMAIL PROTECTED]
AuthorDate: Mon Aug 20 11:05:29 2007 +0100
Committer:  Linus Torvalds [EMAIL PROTECTED]
CommitDate: Mon Aug 20 22:44:27 2007 -0700

JFFS2 locking regression fix.

Commit a491486a2087ac3dfc00efb4f838c8d684afaf54 introduced a locking
problem in JFFS2 -- we up() the alloc_sem when we weren't previously
holding it. This leads to all kinds of fun behaviour later.

There was a _reason_ for the
if (1 /* alternative path needs testing */ ||
which the above-mentioned commit removed :)

Discovered and debugged by Giulio Fedel [EMAIL PROTECTED]

Signed-off-by: David Woodhouse [EMAIL PROTECTED]
Signed-off-by: Linus Torvalds [EMAIL PROTECTED]
---
 fs/jffs2/write.c |3 +++
 1 files changed, 3 insertions(+), 0 deletions(-)

diff --git a/fs/jffs2/write.c b/fs/jffs2/write.c
index bc61859..664c164 100644
--- a/fs/jffs2/write.c
+++ b/fs/jffs2/write.c
@@ -566,6 +566,9 @@ int jffs2_do_unlink(struct jffs2_sb_info *c, struct 
jffs2_inode_info *dir_f,
struct jffs2_full_dirent **prev = dir_f-dents;
uint32_t nhash = full_name_hash(name, namelen);
 
+   /* We don't actually want to reserve any space, but we do
+  want to be holding the alloc_sem when we write to flash */
+   down(c-alloc_sem);
down(dir_f-sem);
 
while ((*prev)  (*prev)-nhash = nhash) {
-
To unsubscribe from this list: send the line unsubscribe git-commits-head in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html


V4L/DVB (5967): ivtv: fix VIDIOC_S_FBUF:new OSD values where never set

2007-08-20 Thread Linux Kernel Mailing List
Gitweb: 
http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=c3624f99a8c06cfe75e0b06f23a7f7cea9d2d5ff
Commit: c3624f99a8c06cfe75e0b06f23a7f7cea9d2d5ff
Parent: c9b0ee2c2af33c2ca722aa05bbcb604487134e4c
Author: Hans Verkuil [EMAIL PROTECTED]
AuthorDate: Tue Jul 31 07:15:56 2007 -0300
Committer:  Mauro Carvalho Chehab [EMAIL PROTECTED]
CommitDate: Mon Aug 20 12:18:02 2007 -0300

V4L/DVB (5967): ivtv: fix VIDIOC_S_FBUF:new OSD values where never set

ivtv: fix VIDIOC_S_FBUF support: new OSD values where never actually set.

The values set with VIDIOC_S_FBUF were not actually used until the next
VIDIOC_S_FMT. Fixed.

Signed-off-by: Hans Verkuil [EMAIL PROTECTED]
Signed-off-by: Mauro Carvalho Chehab [EMAIL PROTECTED]
---
 drivers/media/video/ivtv/ivtv-ioctl.c |1 +
 1 files changed, 1 insertions(+), 0 deletions(-)

diff --git a/drivers/media/video/ivtv/ivtv-ioctl.c 
b/drivers/media/video/ivtv/ivtv-ioctl.c
index 047624b..f2310b7 100644
--- a/drivers/media/video/ivtv/ivtv-ioctl.c
+++ b/drivers/media/video/ivtv/ivtv-ioctl.c
@@ -1190,6 +1190,7 @@ int ivtv_v4l2_ioctls(struct ivtv *itv, struct file *filp, 
unsigned int cmd, void
itv-osd_global_alpha_state = (fb-flags  
V4L2_FBUF_FLAG_GLOBAL_ALPHA) != 0;
itv-osd_local_alpha_state = (fb-flags  
V4L2_FBUF_FLAG_LOCAL_ALPHA) != 0;
itv-osd_color_key_state = (fb-flags  
V4L2_FBUF_FLAG_CHROMAKEY) != 0;
+   ivtv_set_osd_alpha(itv);
break;
}
 
-
To unsubscribe from this list: send the line unsubscribe git-commits-head in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html


V4L/DVB (5969): ivtv: report ivtv version in status log

2007-08-20 Thread Linux Kernel Mailing List
Gitweb: 
http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=de23084a85f6f5030e6760f6e494a9f2a19013d4
Commit: de23084a85f6f5030e6760f6e494a9f2a19013d4
Parent: c3624f99a8c06cfe75e0b06f23a7f7cea9d2d5ff
Author: Hans Verkuil [EMAIL PROTECTED]
AuthorDate: Fri Aug 3 09:33:38 2007 -0300
Committer:  Mauro Carvalho Chehab [EMAIL PROTECTED]
CommitDate: Mon Aug 20 12:18:02 2007 -0300

V4L/DVB (5969): ivtv: report ivtv version in status log

Signed-off-by: Hans Verkuil [EMAIL PROTECTED]
Signed-off-by: Mauro Carvalho Chehab [EMAIL PROTECTED]
---
 drivers/media/video/ivtv/ivtv-ioctl.c |2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/drivers/media/video/ivtv/ivtv-ioctl.c 
b/drivers/media/video/ivtv/ivtv-ioctl.c
index f2310b7..5977a79 100644
--- a/drivers/media/video/ivtv/ivtv-ioctl.c
+++ b/drivers/media/video/ivtv/ivtv-ioctl.c
@@ -1235,7 +1235,7 @@ int ivtv_v4l2_ioctls(struct ivtv *itv, struct file *filp, 
unsigned int cmd, void
IVTV_INFO(Tuner: %s\n,
test_bit(IVTV_F_I_RADIO_USER, itv-i_flags) ? Radio 
: TV);
cx2341x_log_status(itv-params, itv-name);
-   IVTV_INFO(Status flags: 0x%08lx\n, itv-i_flags);
+   IVTV_INFO(Version: %s Status flags: 0x%08lx\n, IVTV_VERSION, 
itv-i_flags);
for (i = 0; i  IVTV_MAX_STREAMS; i++) {
struct ivtv_stream *s = itv-streams[i];
 
-
To unsubscribe from this list: send the line unsubscribe git-commits-head in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html


V4L/DVB (6026): Avoid powering up the camera on resume

2007-08-20 Thread Linux Kernel Mailing List
Gitweb: 
http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=01659f2a0067d855089811529fa596cbc40f1e75
Commit: 01659f2a0067d855089811529fa596cbc40f1e75
Parent: c545d6adbcacd296f7457bd992556feb055379de
Author: Chris Ball [EMAIL PROTECTED]
AuthorDate: Fri Aug 17 01:01:33 2007 -0300
Committer:  Mauro Carvalho Chehab [EMAIL PROTECTED]
CommitDate: Mon Aug 20 12:18:04 2007 -0300

V4L/DVB (6026): Avoid powering up the camera on resume

Signed-off-by: Chris Ball [EMAIL PROTECTED]
Signed-off-by: Jonathan Corbet [EMAIL PROTECTED]
Signed-off-by: Mauro Carvalho Chehab [EMAIL PROTECTED]
---
 drivers/media/video/cafe_ccic.c |   11 ++-
 1 files changed, 10 insertions(+), 1 deletions(-)

diff --git a/drivers/media/video/cafe_ccic.c b/drivers/media/video/cafe_ccic.c
index c08f650..8809010 100644
--- a/drivers/media/video/cafe_ccic.c
+++ b/drivers/media/video/cafe_ccic.c
@@ -2233,12 +2233,21 @@ static int cafe_pci_resume(struct pci_dev *pdev)
if (ret)
return ret;
ret = pci_enable_device(pdev);
+
if (ret) {
cam_warn(cam, Unable to re-enable device on resume!\n);
return ret;
}
cafe_ctlr_init(cam);
-   cafe_ctlr_power_up(cam);
+   cafe_ctlr_power_down(cam);
+
+   mutex_lock(cam-s_mutex);
+   if (cam-users  0) {
+   cafe_ctlr_power_up(cam);
+   __cafe_cam_reset(cam);
+   }
+   mutex_unlock(cam-s_mutex);
+
set_bit(CF_CONFIG_NEEDED, cam-flags);
if (cam-state == S_SPECREAD)
cam-state = S_IDLE;  /* Don't bother restarting */
-
To unsubscribe from this list: send the line unsubscribe git-commits-head in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html


V4L/DVB (6027): Get rid of an ill-behaved msleep in i2c write

2007-08-20 Thread Linux Kernel Mailing List
Gitweb: 
http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=6d77444aca298b43a88086be446f943cd0442ef7
Commit: 6d77444aca298b43a88086be446f943cd0442ef7
Parent: 01659f2a0067d855089811529fa596cbc40f1e75
Author: Jonathan Corbet [EMAIL PROTECTED]
AuthorDate: Fri Aug 17 01:02:33 2007 -0300
Committer:  Mauro Carvalho Chehab [EMAIL PROTECTED]
CommitDate: Mon Aug 20 12:18:04 2007 -0300

V4L/DVB (6027): Get rid of an ill-behaved msleep in i2c write

Configuring the OLPC camera requires something over 150 register
writes.  Unfortunately, querying the CAFE i2c controller too
soon after a write causes the hardware to flake.  The problem had
been solved with an msleep() call, but, between the number of
registers and how msleep() behaves, that resulted in a 3-second
delay on camera initialization.  Instead, we hand-code a wait for
the completion interrupt which avoids reading the status registers.

Signed-off-by: Jonathan Corbet [EMAIL PROTECTED]
Signed-off-by: Mauro Carvalho Chehab [EMAIL PROTECTED]
---
 drivers/media/video/cafe_ccic.c |   22 +-
 drivers/media/video/ov7670.c|5 -
 2 files changed, 25 insertions(+), 2 deletions(-)

diff --git a/drivers/media/video/cafe_ccic.c b/drivers/media/video/cafe_ccic.c
index 8809010..acf64b1 100644
--- a/drivers/media/video/cafe_ccic.c
+++ b/drivers/media/video/cafe_ccic.c
@@ -356,6 +356,7 @@ static int cafe_smbus_write_data(struct cafe_camera *cam,
 {
unsigned int rval;
unsigned long flags;
+   DEFINE_WAIT(the_wait);
 
spin_lock_irqsave(cam-dev_lock, flags);
rval = TWSIC0_EN | ((addr  TWSIC0_SID_SHIFT)  TWSIC0_SID);
@@ -369,10 +370,29 @@ static int cafe_smbus_write_data(struct cafe_camera *cam,
rval = value | ((command  TWSIC1_ADDR_SHIFT)  TWSIC1_ADDR);
cafe_reg_write(cam, REG_TWSIC1, rval);
spin_unlock_irqrestore(cam-dev_lock, flags);
-   msleep(2); /* Required or things flake */
 
+   /*
+* Time to wait for the write to complete.  THIS IS A RACY
+* WAY TO DO IT, but the sad fact is that reading the TWSIC1
+* register too quickly after starting the operation sends
+* the device into a place that may be kinder and better, but
+* which is absolutely useless for controlling the sensor.  In
+* practice we have plenty of time to get into our sleep state
+* before the interrupt hits, and the worst case is that we
+* time out and then see that things completed, so this seems
+* the best way for now.
+*/
+   do {
+   prepare_to_wait(cam-smbus_wait, the_wait,
+   TASK_UNINTERRUPTIBLE);
+   schedule_timeout(1); /* even 1 jiffy is too long */
+   finish_wait(cam-smbus_wait, the_wait);
+   } while (!cafe_smbus_write_done(cam));
+
+#ifdef IF_THE_CAFE_HARDWARE_WORKED_RIGHT
wait_event_timeout(cam-smbus_wait, cafe_smbus_write_done(cam),
CAFE_SMBUS_TIMEOUT);
+#endif
spin_lock_irqsave(cam-dev_lock, flags);
rval = cafe_reg_read(cam, REG_TWSIC1);
spin_unlock_irqrestore(cam-dev_lock, flags);
diff --git a/drivers/media/video/ov7670.c b/drivers/media/video/ov7670.c
index f8f21dd..c4c5bd6 100644
--- a/drivers/media/video/ov7670.c
+++ b/drivers/media/video/ov7670.c
@@ -416,7 +416,10 @@ static int ov7670_read(struct i2c_client *c, unsigned char 
reg,
 static int ov7670_write(struct i2c_client *c, unsigned char reg,
unsigned char value)
 {
-   return i2c_smbus_write_byte_data(c, reg, value);
+   int ret = i2c_smbus_write_byte_data(c, reg, value);
+   if (reg == REG_COM7  (value  COM7_RESET))
+   msleep(2);  /* Wait for reset to run */
+   return ret;
 }
 
 
-
To unsubscribe from this list: send the line unsubscribe git-commits-head in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html


V4L/DVB (6028): Turn an unnecessary mdelay() into msleep().

2007-08-20 Thread Linux Kernel Mailing List
Gitweb: 
http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=70cd685d4b161c9137020ba7ec551cb343cd6fbf
Commit: 70cd685d4b161c9137020ba7ec551cb343cd6fbf
Parent: 6d77444aca298b43a88086be446f943cd0442ef7
Author: Marcelo Tosatti [EMAIL PROTECTED]
AuthorDate: Fri Aug 17 01:03:22 2007 -0300
Committer:  Mauro Carvalho Chehab [EMAIL PROTECTED]
CommitDate: Mon Aug 20 12:18:05 2007 -0300

V4L/DVB (6028): Turn an unnecessary mdelay() into msleep().

Signed-off-by: Jonathan Corbet [EMAIL PROTECTED]
Signed-off-by: Mauro Carvalho Chehab [EMAIL PROTECTED]
---
 drivers/media/video/cafe_ccic.c |2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/drivers/media/video/cafe_ccic.c b/drivers/media/video/cafe_ccic.c
index acf64b1..ef53618 100644
--- a/drivers/media/video/cafe_ccic.c
+++ b/drivers/media/video/cafe_ccic.c
@@ -730,7 +730,7 @@ static void cafe_ctlr_init(struct cafe_camera *cam)
 * Here we must wait a bit for the controller to come around.
 */
spin_unlock_irqrestore(cam-dev_lock, flags);
-   mdelay(5);  /* FIXME revisit this */
+   msleep(5);
spin_lock_irqsave(cam-dev_lock, flags);
 
cafe_reg_write(cam, REG_GL_CSR, GCSR_CCIC_EN|GCSR_SRC|GCSR_MRC);
-
To unsubscribe from this list: send the line unsubscribe git-commits-head in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html


ide: make CONFIG_IDE_GENERIC default to N

2007-08-20 Thread Linux Kernel Mailing List
Gitweb: 
http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=82a0e70e795ee605e1a34a874dd3a3a43b745fb9
Commit: 82a0e70e795ee605e1a34a874dd3a3a43b745fb9
Parent: 2a67789618abb74f0f97d4836a2b937bff2f1b2d
Author: Tejun Heo [EMAIL PROTECTED]
AuthorDate: Mon Aug 20 22:42:53 2007 +0200
Committer:  Bartlomiej Zolnierkiewicz [EMAIL PROTECTED]
CommitDate: Mon Aug 20 22:42:53 2007 +0200

ide: make CONFIG_IDE_GENERIC default to N

These days, CONFIG_IDE_GENERIC causes more confusion and
misconfiguration than it helps.  Especially so because libata is
linked after the generic driver.  Default to N.

Signed-off-by: Tejun Heo [EMAIL PROTECTED]
Acked-by: Jeff Garzik [EMAIL PROTECTED]
Cc: P.C.Chan [EMAIL PROTECTED]
Signed-off-by: Bartlomiej Zolnierkiewicz [EMAIL PROTECTED]
---
 drivers/ide/Kconfig |3 +--
 1 files changed, 1 insertions(+), 2 deletions(-)

diff --git a/drivers/ide/Kconfig b/drivers/ide/Kconfig
index e049f65..e7fcdd2 100644
--- a/drivers/ide/Kconfig
+++ b/drivers/ide/Kconfig
@@ -304,9 +304,8 @@ comment IDE chipset support/bugfixes
 
 config IDE_GENERIC
tristate generic/default IDE chipset support
-   default y
help
- If unsure, say Y.
+ If unsure, say N.
 
 config BLK_DEV_CMD640
bool CMD640 chipset bugfix/support
-
To unsubscribe from this list: send the line unsubscribe git-commits-head in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html


ide: fix hidden dependencies on CONFIG_IDE_GENERIC

2007-08-20 Thread Linux Kernel Mailing List
Gitweb: 
http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=2195dadf853bb32262bd2e5a64f517ae45698c55
Commit: 2195dadf853bb32262bd2e5a64f517ae45698c55
Parent: 82a0e70e795ee605e1a34a874dd3a3a43b745fb9
Author: Bartlomiej Zolnierkiewicz [EMAIL PROTECTED]
AuthorDate: Mon Aug 20 22:42:54 2007 +0200
Committer:  Bartlomiej Zolnierkiewicz [EMAIL PROTECTED]
CommitDate: Mon Aug 20 22:42:54 2007 +0200

ide: fix hidden dependencies on CONFIG_IDE_GENERIC

Some host drivers depend on CONFIG_IDE_GENERIC to do the probing but their
config options lack explicit dependencies on IDE_GENERIC.  In the long-term
these host drivers should be fixed to do the probing themselves but for now
fix them by making their config options select CONFIG_IDE_GENERIC.

Signed-off-by: Bartlomiej Zolnierkiewicz [EMAIL PROTECTED]
---
 arch/cris/arch-v10/drivers/Kconfig |1 +
 arch/cris/arch-v32/drivers/Kconfig |1 +
 drivers/ide/Kconfig|9 +
 3 files changed, 11 insertions(+), 0 deletions(-)

diff --git a/arch/cris/arch-v10/drivers/Kconfig 
b/arch/cris/arch-v10/drivers/Kconfig
index e7e724b..03e2e68 100644
--- a/arch/cris/arch-v10/drivers/Kconfig
+++ b/arch/cris/arch-v10/drivers/Kconfig
@@ -548,6 +548,7 @@ config ETRAX_IDE
select BLK_DEV_IDEDISK
select BLK_DEV_IDECD
select BLK_DEV_IDEDMA
+   select IDE_GENERIC
help
  Enable this to get support for ATA/IDE.
  You can't use parallel ports or SCSI ports
diff --git a/arch/cris/arch-v32/drivers/Kconfig 
b/arch/cris/arch-v32/drivers/Kconfig
index 1d859c1..cc6ba54 100644
--- a/arch/cris/arch-v32/drivers/Kconfig
+++ b/arch/cris/arch-v32/drivers/Kconfig
@@ -592,6 +592,7 @@ config ETRAX_IDE
select BLK_DEV_IDEDISK
select BLK_DEV_IDECD
select BLK_DEV_IDEDMA
+   select IDE_GENERIC
help
  Enables the ETRAX IDE driver.
 
diff --git a/drivers/ide/Kconfig b/drivers/ide/Kconfig
index e7fcdd2..7adb61b 100644
--- a/drivers/ide/Kconfig
+++ b/drivers/ide/Kconfig
@@ -304,6 +304,7 @@ comment IDE chipset support/bugfixes
 
 config IDE_GENERIC
tristate generic/default IDE chipset support
+   default H8300
help
  If unsure, say N.
 
@@ -344,6 +345,7 @@ config BLK_DEV_CMD640_ENHANCED
 config BLK_DEV_IDEPNP
bool PNP EIDE support
depends on PNP
+   select IDE_GENERIC
help
  If you have a PnP (Plug and Play) compatible EIDE card and
  would like the kernel to automatically detect and activate
@@ -833,6 +835,7 @@ config BLK_DEV_IDE_AU1XXX_SEQTS_PER_RQ
 
 config IDE_ARM
def_bool ARM  (ARCH_CLPS7500 || ARCH_RPC || ARCH_SHARK)
+   select IDE_GENERIC
 
 config BLK_DEV_IDE_ICSIDE
tristate ICS IDE interface support
@@ -866,6 +869,7 @@ config BLK_DEV_IDE_BAST
 config BLK_DEV_GAYLE
bool Amiga Gayle IDE interface support
depends on AMIGA
+   select IDE_GENERIC
help
  This is the IDE driver for the Amiga Gayle IDE interface. It supports
  both the `A1200 style' and `A4000 style' of the Gayle IDE interface,
@@ -897,6 +901,7 @@ config BLK_DEV_IDEDOUBLER
 config BLK_DEV_BUDDHA
bool Buddha/Catweasel/X-Surf IDE interface support (EXPERIMENTAL)
depends on ZORRO  EXPERIMENTAL
+   select IDE_GENERIC
help
  This is the IDE driver for the IDE interfaces on the Buddha, 
  Catweasel and X-Surf expansion boards.  It supports up to two 
interfaces 
@@ -909,6 +914,7 @@ config BLK_DEV_BUDDHA
 config BLK_DEV_FALCON_IDE
bool Falcon IDE interface support
depends on ATARI
+   select IDE_GENERIC
help
  This is the IDE driver for the builtin IDE interface on the Atari
  Falcon. Say Y if you have a Falcon and want to use IDE devices (hard
@@ -918,6 +924,7 @@ config BLK_DEV_FALCON_IDE
 config BLK_DEV_MAC_IDE
bool Macintosh Quadra/Powerbook IDE interface support
depends on MAC
+   select IDE_GENERIC
help
  This is the IDE driver for the builtin IDE interface on some m68k
  Macintosh models. It supports both the `Quadra style' (used in
@@ -931,6 +938,7 @@ config BLK_DEV_MAC_IDE
 config BLK_DEV_Q40IDE
bool Q40/Q60 IDE interface support
depends on Q40
+   select IDE_GENERIC
help
  Enable the on-board IDE controller in the Q40/Q60.  This should
  normally be on; disable it only if you are running a custom hard
@@ -939,6 +947,7 @@ config BLK_DEV_Q40IDE
 config BLK_DEV_MPC8xx_IDE
bool MPC8xx IDE support
depends on 8xx  IDE=y  BLK_DEV_IDE=y
+   select IDE_GENERIC
help
  This option provides support for IDE on Motorola MPC8xx Systems.
  Please see 'Type of MPC8xx IDE interface' for details.
-
To unsubscribe from this list: send the line unsubscribe git-commits-head in
the body of a message to [EMAIL PROTECTED]
More 

ide-cris: fix -set_pio_mode method to set transfer mode on the device

2007-08-20 Thread Linux Kernel Mailing List
Gitweb: 
http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=8292e8c7e4c2b99f22120f677858487de43c484b
Commit: 8292e8c7e4c2b99f22120f677858487de43c484b
Parent: 2195dadf853bb32262bd2e5a64f517ae45698c55
Author: Bartlomiej Zolnierkiewicz [EMAIL PROTECTED]
AuthorDate: Mon Aug 20 22:42:54 2007 +0200
Committer:  Bartlomiej Zolnierkiewicz [EMAIL PROTECTED]
CommitDate: Mon Aug 20 22:42:54 2007 +0200

ide-cris: fix -set_pio_mode method to set transfer mode on the device

Acked-by: Sergei Shtylyov [EMAIL PROTECTED]
Signed-off-by: Bartlomiej Zolnierkiewicz [EMAIL PROTECTED]
---
 drivers/ide/cris/ide-cris.c |2 ++
 1 files changed, 2 insertions(+), 0 deletions(-)

diff --git a/drivers/ide/cris/ide-cris.c b/drivers/ide/cris/ide-cris.c
index fbfea46..04636f7 100644
--- a/drivers/ide/cris/ide-cris.c
+++ b/drivers/ide/cris/ide-cris.c
@@ -718,6 +718,8 @@ static void tune_cris_ide(ide_drive_t *drive, u8 pio)
}
 
cris_ide_set_speed(TYPE_PIO, setup, strobe, hold);
+
+   (void)ide_config_drive_speed(drive, XFER_PIO_0 + pio);
 }
 
 static int speed_cris_ide(ide_drive_t *drive, u8 speed)
-
To unsubscribe from this list: send the line unsubscribe git-commits-head in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html


ide: config_drive_for_dma() fixes

2007-08-20 Thread Linux Kernel Mailing List
Gitweb: 
http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=1116fae5fdfa80c6744a9b5d75fb3ef687a69b19
Commit: 1116fae5fdfa80c6744a9b5d75fb3ef687a69b19
Parent: 8292e8c7e4c2b99f22120f677858487de43c484b
Author: Bartlomiej Zolnierkiewicz [EMAIL PROTECTED]
AuthorDate: Mon Aug 20 22:42:55 2007 +0200
Committer:  Bartlomiej Zolnierkiewicz [EMAIL PROTECTED]
CommitDate: Mon Aug 20 22:42:55 2007 +0200

ide: config_drive_for_dma() fixes

* Add DMA blacklist checking (-ide_dma_on check probably can go now).

* Add -atapi_dma flag checking and remove no longer needed
  ns87415_ide_dma_check() from ns87415 host driver.

* Remove now needless __ide_dma_check() wrapper and symbol export.

* Check drive-autodma instead of hwif-autodma (there should be no changes 
in
  behavior as all users of config_drive_for_dma() set both -autodma flags).

Signed-off-by: Bartlomiej Zolnierkiewicz [EMAIL PROTECTED]
---
 drivers/ide/ide-dma.c |   26 ++
 drivers/ide/pci/ns87415.c |9 -
 include/linux/ide.h   |1 -
 3 files changed, 10 insertions(+), 26 deletions(-)

diff --git a/drivers/ide/ide-dma.c b/drivers/ide/ide-dma.c
index 5fe1d72..865a274 100644
--- a/drivers/ide/ide-dma.c
+++ b/drivers/ide/ide-dma.c
@@ -349,9 +349,17 @@ EXPORT_SYMBOL_GPL(ide_destroy_dmatable);
  
 static int config_drive_for_dma (ide_drive_t *drive)
 {
+   ide_hwif_t *hwif = drive-hwif;
struct hd_driveid *id = drive-id;
 
-   if ((id-capability  1)  drive-hwif-autodma) {
+   /* consult the list of known bad drives */
+   if (__ide_dma_bad_drive(drive))
+   return -1;
+
+   if (drive-media != ide_disk  hwif-atapi_dma == 0)
+   return -1;
+
+   if ((id-capability  1)  drive-autodma) {
/*
 * Enable DMA on any drive that has
 * UltraDMA (mode 0/1/2/3/4/5/6) enabled
@@ -514,20 +522,6 @@ int __ide_dma_on (ide_drive_t *drive)
 EXPORT_SYMBOL(__ide_dma_on);
 
 /**
- * __ide_dma_check -   check DMA setup
- * @drive: drive to check
- *
- * Don't use - due for extermination
- */
- 
-int __ide_dma_check (ide_drive_t *drive)
-{
-   return config_drive_for_dma(drive);
-}
-
-EXPORT_SYMBOL(__ide_dma_check);
-
-/**
  * ide_dma_setup   -   begin a DMA phase
  * @drive: target device
  *
@@ -1021,7 +1015,7 @@ void ide_setup_dma (ide_hwif_t *hwif, unsigned long 
dma_base, unsigned int num_p
if (!hwif-dma_host_on)
hwif-dma_host_on = ide_dma_host_on;
if (!hwif-ide_dma_check)
-   hwif-ide_dma_check = __ide_dma_check;
+   hwif-ide_dma_check = config_drive_for_dma;
if (!hwif-dma_setup)
hwif-dma_setup = ide_dma_setup;
if (!hwif-dma_exec_cmd)
diff --git a/drivers/ide/pci/ns87415.c b/drivers/ide/pci/ns87415.c
index 09941f3..465c935 100644
--- a/drivers/ide/pci/ns87415.c
+++ b/drivers/ide/pci/ns87415.c
@@ -187,14 +187,6 @@ static int ns87415_ide_dma_setup(ide_drive_t *drive)
return 1;
 }
 
-static int ns87415_ide_dma_check (ide_drive_t *drive)
-{
-   if (drive-media != ide_disk)
-   return -1;
-
-   return __ide_dma_check(drive);
-}
-
 static void __devinit init_hwif_ns87415 (ide_hwif_t *hwif)
 {
struct pci_dev *dev = hwif-pci_dev;
@@ -266,7 +258,6 @@ static void __devinit init_hwif_ns87415 (ide_hwif_t *hwif)
 
outb(0x60, hwif-dma_status);
hwif-dma_setup = ns87415_ide_dma_setup;
-   hwif-ide_dma_check = ns87415_ide_dma_check;
hwif-ide_dma_end = ns87415_ide_dma_end;
 
if (!noautodma)
diff --git a/include/linux/ide.h b/include/linux/ide.h
index d71d012..7e15e08 100644
--- a/include/linux/ide.h
+++ b/include/linux/ide.h
@@ -1312,7 +1312,6 @@ void ide_dma_host_off(ide_drive_t *);
 void ide_dma_off_quietly(ide_drive_t *);
 void ide_dma_host_on(ide_drive_t *);
 extern int __ide_dma_on(ide_drive_t *);
-extern int __ide_dma_check(ide_drive_t *);
 extern int ide_dma_setup(ide_drive_t *);
 extern void ide_dma_start(ide_drive_t *);
 extern int __ide_dma_end(ide_drive_t *);
-
To unsubscribe from this list: send the line unsubscribe git-commits-head in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html


ide-pmac: fix drive-init_speed reporting

2007-08-20 Thread Linux Kernel Mailing List
Gitweb: 
http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=59785c8fe23ca2f432bc41ef473a8933ab435812
Commit: 59785c8fe23ca2f432bc41ef473a8933ab435812
Parent: 1116fae5fdfa80c6744a9b5d75fb3ef687a69b19
Author: Bartlomiej Zolnierkiewicz [EMAIL PROTECTED]
AuthorDate: Mon Aug 20 22:42:55 2007 +0200
Committer:  Bartlomiej Zolnierkiewicz [EMAIL PROTECTED]
CommitDate: Mon Aug 20 22:42:55 2007 +0200

ide-pmac: fix drive-init_speed reporting

pmac_ide_tune_chipset() don't set drive-init_speed.

Fix it by setting drive-{current,init}_speed in pmac_ide_do_setfeature()
and clean up pmac_ide_{tune_chipset,mdma_enable,udma_enable}().

Acked-by: Benjamin Herrenschmidt [EMAIL PROTECTED]
Signed-off-by: Bartlomiej Zolnierkiewicz [EMAIL PROTECTED]
---
 drivers/ide/ppc/pmac.c |   14 +++---
 1 files changed, 3 insertions(+), 11 deletions(-)

diff --git a/drivers/ide/ppc/pmac.c b/drivers/ide/ppc/pmac.c
index 33630ad..4b13cd9 100644
--- a/drivers/ide/ppc/pmac.c
+++ b/drivers/ide/ppc/pmac.c
@@ -604,6 +604,9 @@ out:
drive-id-dma_1word |= 0x0101; break;
default: break;
}
+   if (!drive-init_speed)
+   drive-init_speed = command;
+   drive-current_speed = command;
}
enable_irq(hwif-irq);
return result;
@@ -986,7 +989,6 @@ pmac_ide_tune_chipset (ide_drive_t *drive, byte speed)
return ret;

pmac_ide_do_update_timings(drive);  
-   drive-current_speed = speed;
 
return 0;
 }
@@ -1737,11 +1739,6 @@ pmac_ide_mdma_enable(ide_drive_t *drive, u16 mode)
/* Apply timings to controller */
*timings = timing_local[0];
*timings2 = timing_local[1];
-   
-   /* Set speed info in drive */
-   drive-current_speed = mode;
-   if (!drive-init_speed)
-   drive-init_speed = mode;
 
return 1;
 }
@@ -1793,11 +1790,6 @@ pmac_ide_udma_enable(ide_drive_t *drive, u16 mode)
*timings = timing_local[0];
*timings2 = timing_local[1];
 
-   /* Set speed info in drive */
-   drive-current_speed = mode;
-   if (!drive-init_speed)
-   drive-init_speed = mode;
-
return 1;
 }
 
-
To unsubscribe from this list: send the line unsubscribe git-commits-head in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html


ide: add cable detection for early UDMA66 devices (take 3)

2007-08-20 Thread Linux Kernel Mailing List
Gitweb: 
http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=a5b7e70d787f528386eda025d3e38f545017f241
Commit: a5b7e70d787f528386eda025d3e38f545017f241
Parent: 59785c8fe23ca2f432bc41ef473a8933ab435812
Author: Bartlomiej Zolnierkiewicz [EMAIL PROTECTED]
AuthorDate: Mon Aug 20 22:42:56 2007 +0200
Committer:  Bartlomiej Zolnierkiewicz [EMAIL PROTECTED]
CommitDate: Mon Aug 20 22:42:56 2007 +0200

ide: add cable detection for early UDMA66 devices (take 3)

* Move ide_in_drive_list() from ide-dma.c to ide-iops.c.

* Add ivb_list[] table for listening early UDMA66 devices which don't 
conform
  to ATA4 standard wrt cable detection (bit14 is zero, only bit13 is valid)
  and use only device side cable detection for them since host side cable
  detection may be unreliable.

* Add model QUANTUM FIREBALLlct10 05 with firwmare A03.0900 to the list
  (from Craig's bugreport).

v2:
* Improve kernel message basing on suggestion from Sergei.

v3:
* Don't print kernel message when no device side cable detection is done,
  plus some minor fixes.  (Noticed by Sergei)

Thanks to Craig for testing this patch.

Cc: Craig Block [EMAIL PROTECTED]
Acked-by: Sergei Shtylyov [EMAIL PROTECTED]
Signed-off-by: Bartlomiej Zolnierkiewicz [EMAIL PROTECTED]
---
 drivers/ide/ide-dma.c  |   19 ---
 drivers/ide/ide-iops.c |   39 ---
 include/linux/ide.h|3 ++-
 3 files changed, 38 insertions(+), 23 deletions(-)

diff --git a/drivers/ide/ide-dma.c b/drivers/ide/ide-dma.c
index 865a274..ff644a5 100644
--- a/drivers/ide/ide-dma.c
+++ b/drivers/ide/ide-dma.c
@@ -135,25 +135,6 @@ static const struct drive_list_entry drive_blacklist [] = {
 };
 
 /**
- * ide_in_drive_list   -   look for drive in black/white list
- * @id: drive identifier
- * @drive_table: list to inspect
- *
- * Look for a drive in the blacklist and the whitelist tables
- * Returns 1 if the drive is found in the table.
- */
-
-int ide_in_drive_list(struct hd_driveid *id, const struct drive_list_entry 
*drive_table)
-{
-   for ( ; drive_table-id_model ; drive_table++)
-   if ((!strcmp(drive_table-id_model, id-model)) 
-   (!drive_table-id_firmware ||
-strstr(id-fw_rev, drive_table-id_firmware)))
-   return 1;
-   return 0;
-}
-
-/**
  * ide_dma_intr-   IDE DMA interrupt handler
  * @drive: the drive the interrupt is for
  *
diff --git a/drivers/ide/ide-iops.c b/drivers/ide/ide-iops.c
index 92578b6..fe2a69f 100644
--- a/drivers/ide/ide-iops.c
+++ b/drivers/ide/ide-iops.c
@@ -565,6 +565,34 @@ int ide_wait_stat (ide_startstop_t *startstop, ide_drive_t 
*drive, u8 good, u8 b
 
 EXPORT_SYMBOL(ide_wait_stat);
 
+/**
+ * ide_in_drive_list   -   look for drive in black/white list
+ * @id: drive identifier
+ * @drive_table: list to inspect
+ *
+ * Look for a drive in the blacklist and the whitelist tables
+ * Returns 1 if the drive is found in the table.
+ */
+
+int ide_in_drive_list(struct hd_driveid *id, const struct drive_list_entry 
*drive_table)
+{
+   for ( ; drive_table-id_model; drive_table++)
+   if ((!strcmp(drive_table-id_model, id-model)) 
+   (!drive_table-id_firmware ||
+strstr(id-fw_rev, drive_table-id_firmware)))
+   return 1;
+   return 0;
+}
+
+/*
+ * Early UDMA66 devices don't set bit14 to 1, only bit13 is valid.
+ * We list them here and depend on the device side cable detection for them.
+ */
+static const struct drive_list_entry ivb_list[] = {
+   { QUANTUM FIREBALLlct10 05, A03.0900},
+   { NULL  , NULL  }
+};
+
 /*
  *  All hosts that use the 80c ribbon must use!
  *  The name is derived from upper byte of word 93 and the 80c ribbon.
@@ -573,11 +601,16 @@ u8 eighty_ninty_three (ide_drive_t *drive)
 {
ide_hwif_t *hwif = drive-hwif;
struct hd_driveid *id = drive-id;
+   int ivb = ide_in_drive_list(id, ivb_list);
 
if (hwif-cbl == ATA_CBL_PATA40_SHORT)
return 1;
 
-   if (hwif-cbl != ATA_CBL_PATA80)
+   if (ivb)
+   printk(KERN_DEBUG %s: skipping word 93 validity check\n,
+ drive-name);
+
+   if (hwif-cbl != ATA_CBL_PATA80  !ivb)
goto no_80w;
 
/* Check for SATA but only if we are ATA5 or higher */
@@ -587,11 +620,11 @@ u8 eighty_ninty_three (ide_drive_t *drive)
/*
 * FIXME:
 * - change master/slave IDENTIFY order
-* - force bit13 (80c cable present) check
+* - force bit13 (80c cable present) check also for !ivb devices
 *   (unless the slave device is pre-ATA3)
 */
 #ifndef CONFIG_IDEDMA_IVB
-   if (id-hw_config  0x4000)
+   

ide: ide_config_drive_speed() bugfixes

2007-08-20 Thread Linux Kernel Mailing List
Gitweb: 
http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=adcd33d41bfea8fb6870cf1f7e7ed2e5f7323fc1
Commit: adcd33d41bfea8fb6870cf1f7e7ed2e5f7323fc1
Parent: a5b7e70d787f528386eda025d3e38f545017f241
Author: Bartlomiej Zolnierkiewicz [EMAIL PROTECTED]
AuthorDate: Mon Aug 20 22:42:56 2007 +0200
Committer:  Bartlomiej Zolnierkiewicz [EMAIL PROTECTED]
CommitDate: Mon Aug 20 22:42:56 2007 +0200

ide: ide_config_drive_speed() bugfixes

* Use -OUTBSYNC instead of -OUTB when writing command register
  (needed for scc_pata and pmac host drivers).

* Don't check DRDY bit of the status register on ATAPI devices
  (ATAPI devices are free to ignore DRDY bit).

Cc: Benjamin Herrenschmidt [EMAIL PROTECTED]
Cc: Kou Ishizaki [EMAIL PROTECTED]
Cc: Akira Iguchi [EMAIL PROTECTED]
Acked-by: Sergei Shtylyov [EMAIL PROTECTED]
Signed-off-by: Bartlomiej Zolnierkiewicz [EMAIL PROTECTED]
---
 drivers/ide/ide-iops.c |4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/ide/ide-iops.c b/drivers/ide/ide-iops.c
index fe2a69f..18cf3a6 100644
--- a/drivers/ide/ide-iops.c
+++ b/drivers/ide/ide-iops.c
@@ -828,7 +828,7 @@ int ide_config_drive_speed (ide_drive_t *drive, u8 speed)
hwif-OUTB(drive-ctl | 2, IDE_CONTROL_REG);
hwif-OUTB(speed, IDE_NSECTOR_REG);
hwif-OUTB(SETFEATURES_XFER, IDE_FEATURE_REG);
-   hwif-OUTB(WIN_SETFEATURES, IDE_COMMAND_REG);
+   hwif-OUTBSYNC(drive, WIN_SETFEATURES, IDE_COMMAND_REG);
if ((IDE_CONTROL_REG)  (drive-quirk_list == 2))
hwif-OUTB(drive-ctl, IDE_CONTROL_REG);
udelay(1);
@@ -855,7 +855,7 @@ int ide_config_drive_speed (ide_drive_t *drive, u8 speed)
 */
for (i = 0; i  10; i++) {
udelay(1);
-   if (OK_STAT((stat = hwif-INB(IDE_STATUS_REG)), DRIVE_READY, 
BUSY_STAT|DRQ_STAT|ERR_STAT)) {
+   if (OK_STAT((stat = hwif-INB(IDE_STATUS_REG)), 
drive-ready_stat, BUSY_STAT|DRQ_STAT|ERR_STAT)) {
error = 0;
break;
}
-
To unsubscribe from this list: send the line unsubscribe git-commits-head in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html


cs5530: add missing -dma_base check

2007-08-20 Thread Linux Kernel Mailing List
Gitweb: 
http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=f7b0d2df2f6fd9abdf47b4a1965dcaa2870e35df
Commit: f7b0d2df2f6fd9abdf47b4a1965dcaa2870e35df
Parent: adcd33d41bfea8fb6870cf1f7e7ed2e5f7323fc1
Author: Bartlomiej Zolnierkiewicz [EMAIL PROTECTED]
AuthorDate: Mon Aug 20 22:42:56 2007 +0200
Committer:  Bartlomiej Zolnierkiewicz [EMAIL PROTECTED]
CommitDate: Mon Aug 20 22:42:56 2007 +0200

cs5530: add missing -dma_base check

If -dma_base is not set (== PCI BAR4 cannot be reserved) then DMA hooks
shouldn't be initialized or bad things will happen.

Also this host driver requires valid PCI BAR4 for normal operation so
check it in -init_chipset and fail initialization if not set.

Signed-off-by: Bartlomiej Zolnierkiewicz [EMAIL PROTECTED]
---
 drivers/ide/pci/cs5530.c |8 +++-
 1 files changed, 7 insertions(+), 1 deletions(-)

diff --git a/drivers/ide/pci/cs5530.c b/drivers/ide/pci/cs5530.c
index acaf71f..e5949b1 100644
--- a/drivers/ide/pci/cs5530.c
+++ b/drivers/ide/pci/cs5530.c
@@ -1,5 +1,5 @@
 /*
- * linux/drivers/ide/pci/cs5530.c  Version 0.73Mar 10 2007
+ * linux/drivers/ide/pci/cs5530.c  Version 0.74Jul 28 2007
  *
  * Copyright (C) 2000  Andre Hedrick [EMAIL PROTECTED]
  * Copyright (C) 2000  Mark Lord [EMAIL PROTECTED]
@@ -207,6 +207,9 @@ static unsigned int __devinit init_chipset_cs5530 (struct 
pci_dev *dev, const ch
struct pci_dev *master_0 = NULL, *cs5530_0 = NULL;
unsigned long flags;
 
+   if (pci_resource_start(dev, 4) == 0)
+   return -EFAULT;
+
dev = NULL;
while ((dev = pci_get_device(PCI_VENDOR_ID_CYRIX, PCI_ANY_ID, dev)) != 
NULL) {
switch (dev-device) {
@@ -325,6 +328,9 @@ static void __devinit init_hwif_cs5530 (ide_hwif_t *hwif)
/* needs autotuning later */
}
 
+   if (hwif-dma_base == 0)
+   return;
+
hwif-atapi_dma = 1;
hwif-ultra_mask = 0x07;
hwif-mwdma_mask = 0x07;
-
To unsubscribe from this list: send the line unsubscribe git-commits-head in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html


pdc202xx_new: add missing -dma_base check

2007-08-20 Thread Linux Kernel Mailing List
Gitweb: 
http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=01cc643ae3c7de35b63989b7b65e3ef3132e48e4
Commit: 01cc643ae3c7de35b63989b7b65e3ef3132e48e4
Parent: f7b0d2df2f6fd9abdf47b4a1965dcaa2870e35df
Author: Bartlomiej Zolnierkiewicz [EMAIL PROTECTED]
AuthorDate: Mon Aug 20 22:42:56 2007 +0200
Committer:  Bartlomiej Zolnierkiewicz [EMAIL PROTECTED]
CommitDate: Mon Aug 20 22:42:56 2007 +0200

pdc202xx_new: add missing -dma_base check

If -dma_base is not set (== PCI BAR4 cannot be reserved) then DMA hooks
shouldn't be initialized or bad things will happen.

Also this host driver requires valid PCI BAR4 for normal operation so
check it in -init_chipset and fail initialization if not set.

Signed-off-by: Bartlomiej Zolnierkiewicz [EMAIL PROTECTED]
---
 drivers/ide/pci/pdc202xx_new.c |   10 --
 1 files changed, 8 insertions(+), 2 deletions(-)

diff --git a/drivers/ide/pci/pdc202xx_new.c b/drivers/ide/pci/pdc202xx_new.c
index 8a66a28..f6db2f3 100644
--- a/drivers/ide/pci/pdc202xx_new.c
+++ b/drivers/ide/pci/pdc202xx_new.c
@@ -378,6 +378,9 @@ static unsigned int __devinit init_chipset_pdcnew(struct 
pci_dev *dev, const cha
int f, r;
u8 pll_ctl0, pll_ctl1;
 
+   if (dma_base == 0)
+   return -EFAULT;
+
 #ifdef CONFIG_PPC_PMAC
apple_kiwi_init(dev);
 #endif
@@ -494,15 +497,18 @@ static void __devinit init_hwif_pdc202new(ide_hwif_t 
*hwif)
hwif-speedproc = pdcnew_tune_chipset;
hwif-resetproc = pdcnew_reset;
 
+   hwif-err_stops_fifo = 1;
+
hwif-drives[0].autotune = hwif-drives[1].autotune = 1;
 
+   if (hwif-dma_base == 0)
+   return;
+
hwif-atapi_dma  = 1;
 
hwif-ultra_mask = hwif-cds-udma_mask;
hwif-mwdma_mask = 0x07;
 
-   hwif-err_stops_fifo = 1;
-
hwif-ide_dma_check = pdcnew_config_drive_xfer_rate;
 
if (hwif-cbl != ATA_CBL_PATA40_SHORT)
-
To unsubscribe from this list: send the line unsubscribe git-commits-head in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html


pdc202xx_old: add missing -dma_base check

2007-08-20 Thread Linux Kernel Mailing List
Gitweb: 
http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=e98d6e50be87c1ad2df81f73c7442cf631d6f931
Commit: e98d6e50be87c1ad2df81f73c7442cf631d6f931
Parent: 01cc643ae3c7de35b63989b7b65e3ef3132e48e4
Author: Bartlomiej Zolnierkiewicz [EMAIL PROTECTED]
AuthorDate: Mon Aug 20 22:42:56 2007 +0200
Committer:  Bartlomiej Zolnierkiewicz [EMAIL PROTECTED]
CommitDate: Mon Aug 20 22:42:56 2007 +0200

pdc202xx_old: add missing -dma_base check

If -dma_base is not set (== PCI BAR4 cannot be reserved) then DMA hooks
shouldn't be initialized or bad things will happen.

Acked-by: Sergei Shtylyov [EMAIL PROTECTED]
Signed-off-by: Bartlomiej Zolnierkiewicz [EMAIL PROTECTED]
---
 drivers/ide/pci/pdc202xx_old.c |9 ++---
 1 files changed, 6 insertions(+), 3 deletions(-)

diff --git a/drivers/ide/pci/pdc202xx_old.c b/drivers/ide/pci/pdc202xx_old.c
index fbcb0bb..e19a891 100644
--- a/drivers/ide/pci/pdc202xx_old.c
+++ b/drivers/ide/pci/pdc202xx_old.c
@@ -1,5 +1,5 @@
 /*
- *  linux/drivers/ide/pci/pdc202xx_old.c   Version 0.50Mar 3, 2007
+ *  linux/drivers/ide/pci/pdc202xx_old.c   Version 0.51Jul 27, 2007
  *
  *  Copyright (C) 1998-2002Andre Hedrick [EMAIL PROTECTED]
  *  Copyright (C) 2006-2007MontaVista Software, Inc.
@@ -337,15 +337,18 @@ static void __devinit init_hwif_pdc202xx(ide_hwif_t *hwif)
 
hwif-speedproc = pdc202xx_tune_chipset;
 
+   hwif-err_stops_fifo = 1;
+
hwif-drives[0].autotune = hwif-drives[1].autotune = 1;
 
+   if (hwif-dma_base == 0)
+   return;
+
hwif-ultra_mask = hwif-cds-udma_mask;
hwif-mwdma_mask = 0x07;
hwif-swdma_mask = 0x07;
hwif-atapi_dma = 1;
 
-   hwif-err_stops_fifo = 1;
-
hwif-ide_dma_check = pdc202xx_config_drive_xfer_rate;
hwif-dma_lost_irq = pdc202xx_dma_lost_irq;
hwif-dma_timeout = pdc202xx_dma_timeout;
-
To unsubscribe from this list: send the line unsubscribe git-commits-head in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html


triflex: add missing -dma_base check

2007-08-20 Thread Linux Kernel Mailing List
Gitweb: 
http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=88b47040f8365ad56ecfd4103e964ba9b695987e
Commit: 88b47040f8365ad56ecfd4103e964ba9b695987e
Parent: e98d6e50be87c1ad2df81f73c7442cf631d6f931
Author: Bartlomiej Zolnierkiewicz [EMAIL PROTECTED]
AuthorDate: Mon Aug 20 22:42:56 2007 +0200
Committer:  Bartlomiej Zolnierkiewicz [EMAIL PROTECTED]
CommitDate: Mon Aug 20 22:42:56 2007 +0200

triflex: add missing -dma_base check

If -dma_base is not set (== PCI BAR4 cannot be reserved) then DMA hooks
shouldn't be initialized or bad things will happen.

Acked-by: Sergei Shtylyov [EMAIL PROTECTED]
Signed-off-by: Bartlomiej Zolnierkiewicz [EMAIL PROTECTED]
---
 drivers/ide/pci/triflex.c |3 +++
 1 files changed, 3 insertions(+), 0 deletions(-)

diff --git a/drivers/ide/pci/triflex.c b/drivers/ide/pci/triflex.c
index 024bbfa..098692a 100644
--- a/drivers/ide/pci/triflex.c
+++ b/drivers/ide/pci/triflex.c
@@ -115,6 +115,9 @@ static void __devinit init_hwif_triflex(ide_hwif_t *hwif)
hwif-tuneproc = triflex_tune_drive;
hwif-speedproc = triflex_tune_chipset;
 
+   if (hwif-dma_base == 0)
+   return;
+
hwif-atapi_dma  = 1;
hwif-mwdma_mask = 0x07;
hwif-swdma_mask = 0x07;
-
To unsubscribe from this list: send the line unsubscribe git-commits-head in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html


hpt34x: fix CONFIG_HPT34X_AUTODMA=n handling

2007-08-20 Thread Linux Kernel Mailing List
Gitweb: 
http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=76e1faa7cfd464fa06a9c2cafd633d643daafeae
Commit: 76e1faa7cfd464fa06a9c2cafd633d643daafeae
Parent: 88b47040f8365ad56ecfd4103e964ba9b695987e
Author: Bartlomiej Zolnierkiewicz [EMAIL PROTECTED]
AuthorDate: Mon Aug 20 22:42:57 2007 +0200
Committer:  Bartlomiej Zolnierkiewicz [EMAIL PROTECTED]
CommitDate: Mon Aug 20 22:42:57 2007 +0200

hpt34x: fix CONFIG_HPT34X_AUTODMA=n handling

Programming DMA mode may destroy current PIO mode setting so if
CONFIG_HPT34X_AUTODMA=n (the default case) make ide_tune_dma() fail
early by disabling all host DMA masks and re-tune PIO mode.

This fix doesn't help with the driver being broken but is needed
for some other changes.

Signed-off-by: Bartlomiej Zolnierkiewicz [EMAIL PROTECTED]
---
 drivers/ide/pci/hpt34x.c |6 ++
 1 files changed, 2 insertions(+), 4 deletions(-)

diff --git a/drivers/ide/pci/hpt34x.c b/drivers/ide/pci/hpt34x.c
index 19778c5..cb8fe56 100644
--- a/drivers/ide/pci/hpt34x.c
+++ b/drivers/ide/pci/hpt34x.c
@@ -89,11 +89,7 @@ static int hpt34x_config_drive_xfer_rate (ide_drive_t *drive)
drive-init_speed = 0;
 
if (ide_tune_dma(drive))
-#ifndef CONFIG_HPT34X_AUTODMA
return -1;
-#else
-   return 0;
-#endif
 
if (ide_use_fast_pio(drive))
hpt34x_tune_drive(drive, 255);
@@ -160,9 +156,11 @@ static void __devinit init_hwif_hpt34x(ide_hwif_t *hwif)
if (!hwif-dma_base)
return;
 
+#ifdef CONFIG_HPT34X_AUTODMA
hwif-ultra_mask = 0x07;
hwif-mwdma_mask = 0x07;
hwif-swdma_mask = 0x07;
+#endif
 
hwif-ide_dma_check = hpt34x_config_drive_xfer_rate;
if (!noautodma)
-
To unsubscribe from this list: send the line unsubscribe git-commits-head in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html


ide-disk: workaround for buggy HPA support on ST340823A (take 3)

2007-08-20 Thread Linux Kernel Mailing List
Gitweb: 
http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=b0244a00451c1ad64bf0a51f50679f7146786780
Commit: b0244a00451c1ad64bf0a51f50679f7146786780
Parent: 76e1faa7cfd464fa06a9c2cafd633d643daafeae
Author: Bartlomiej Zolnierkiewicz [EMAIL PROTECTED]
AuthorDate: Mon Aug 20 22:42:57 2007 +0200
Committer:  Bartlomiej Zolnierkiewicz [EMAIL PROTECTED]
CommitDate: Mon Aug 20 22:42:57 2007 +0200

ide-disk: workaround for buggy HPA support on ST340823A (take 3)

This disk reports total number of sectors instead of maximum sector address
in response to READ_NATIVE_MAX_ADDRESS command and also happily accepts
SET_MAX_ADDRESS command with the bogus value.  This results in +1 sector
capacity being used and errors on attempts to use the last sector.

...
hdd: Host Protected Area detected.
        current capacity is 78165360 sectors (40020 MB)
        native  capacity is 78165361 sectors (40020 MB)
hdd: Host Protected Area disabled.
...
hdd: reading: block=78165360, sectors=1, buffer=0xc1e63000
hdd: dma_intr: status=0x51 { DriveReady SeekComplete Error }
hdd: dma_intr: error=0x10 { SectorIdNotFound }, LBAsect=78165360, 
sector=78165360
...

Add hpa_list[] table and workaround the issue in idedisk_check_hpa().

v2:
* Add missing export and improve patch description a bit.

v3:
* Add list termination.  (From Mikko)

Fixes kernel bugzilla bug #8816.

Thanks to Mikko for investigating the issue and helping with this patch.

Cc: Mikko Rapeli [EMAIL PROTECTED]
Cc: Alan Cox [EMAIL PROTECTED]
Signed-off-by: Bartlomiej Zolnierkiewicz [EMAIL PROTECTED]
---
 drivers/ide/ide-disk.c |   18 ++
 drivers/ide/ide-iops.c |2 ++
 2 files changed, 20 insertions(+), 0 deletions(-)

diff --git a/drivers/ide/ide-disk.c b/drivers/ide/ide-disk.c
index 5ce4216..eba1adb 100644
--- a/drivers/ide/ide-disk.c
+++ b/drivers/ide/ide-disk.c
@@ -481,6 +481,15 @@ static inline int idedisk_supports_lba48(const struct 
hd_driveid *id)
id-lba_capacity_2;
 }
 
+/*
+ * Some disks report total number of sectors instead of
+ * maximum sector address.  We list them here.
+ */
+static const struct drive_list_entry hpa_list[] = {
+   { ST340823A,  NULL },
+   { NULL, NULL }
+};
+
 static void idedisk_check_hpa(ide_drive_t *drive)
 {
unsigned long long capacity, set_max;
@@ -492,6 +501,15 @@ static void idedisk_check_hpa(ide_drive_t *drive)
else
set_max = idedisk_read_native_max_address(drive);
 
+   if (ide_in_drive_list(drive-id, hpa_list)) {
+   /*
+* Since we are inclusive wrt to firmware revisions do this
+* extra check and apply the workaround only when needed.
+*/
+   if (set_max == capacity + 1)
+   set_max--;
+   }
+
if (set_max = capacity)
return;
 
diff --git a/drivers/ide/ide-iops.c b/drivers/ide/ide-iops.c
index 18cf3a6..f4cd270 100644
--- a/drivers/ide/ide-iops.c
+++ b/drivers/ide/ide-iops.c
@@ -584,6 +584,8 @@ int ide_in_drive_list(struct hd_driveid *id, const struct 
drive_list_entry *driv
return 0;
 }
 
+EXPORT_SYMBOL_GPL(ide_in_drive_list);
+
 /*
  * Early UDMA66 devices don't set bit14 to 1, only bit13 is valid.
  * We list them here and depend on the device side cable detection for them.
-
To unsubscribe from this list: send the line unsubscribe git-commits-head in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html


dio: zero struct dio with kzalloc instead of manually

2007-08-20 Thread Linux Kernel Mailing List
Gitweb: 
http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=848c4dd5153c7a0de55470ce99a8e13a63b4703f
Commit: 848c4dd5153c7a0de55470ce99a8e13a63b4703f
Parent: 38f061c5714265fa8481cc0b7795aa8fe81b45be
Author: Zach Brown [EMAIL PROTECTED]
AuthorDate: Mon Aug 20 17:12:01 2007 -0700
Committer:  Linus Torvalds [EMAIL PROTECTED]
CommitDate: Mon Aug 20 22:50:25 2007 -0700

dio: zero struct dio with kzalloc instead of manually

This patch uses kzalloc to zero all of struct dio rather than manually
trying to track which fields we rely on being zero.  It passed aio+dio
stress testing and some bug regression testing on ext3.

This patch was introduced by Linus in the conversation that lead up to
Badari's minimal fix to manually zero .map_bh.b_state in commit:

  6a648fa72161d1f6468dabd96c5d3c0db04f598a

It makes the code a bit smaller.  Maybe a couple fewer cachelines to
load, if we're lucky:

   textdata bss dec hex filename
3285925  568506 1304616 5159047  4eb887 vmlinux
3285797  568506 1304616 5158919  4eb807 vmlinux.patched

I was unable to measure a stable difference in the number of cpu cycles
spent in blockdev_direct_IO() when pushing aio+dio 256K reads at
~340MB/s.

So the resulting intent of the patch isn't a performance gain but to
avoid exposing ourselves to the risk of finding another field like
.map_bh.b_state where we rely on zeroing but don't enforce it in the
code.

Signed-off-by: Zach Brown [EMAIL PROTECTED]
Signed-off-by: Linus Torvalds [EMAIL PROTECTED]
---
 fs/direct-io.c |   18 +-
 1 files changed, 1 insertions(+), 17 deletions(-)

diff --git a/fs/direct-io.c b/fs/direct-io.c
index 6874785..901dc55 100644
--- a/fs/direct-io.c
+++ b/fs/direct-io.c
@@ -958,36 +958,22 @@ direct_io_worker(int rw, struct kiocb *iocb, struct inode 
*inode,
ssize_t ret2;
size_t bytes;
 
-   dio-bio = NULL;
dio-inode = inode;
dio-rw = rw;
dio-blkbits = blkbits;
dio-blkfactor = inode-i_blkbits - blkbits;
-   dio-start_zero_done = 0;
-   dio-size = 0;
dio-block_in_file = offset  blkbits;
-   dio-blocks_available = 0;
-   dio-cur_page = NULL;
 
-   dio-boundary = 0;
-   dio-reap_counter = 0;
dio-get_block = get_block;
dio-end_io = end_io;
-   dio-map_bh.b_private = NULL;
-   dio-map_bh.b_state = 0;
dio-final_block_in_bio = -1;
dio-next_block_for_io = -1;
 
-   dio-page_errors = 0;
-   dio-io_error = 0;
-   dio-result = 0;
dio-iocb = iocb;
dio-i_size = i_size_read(inode);
 
spin_lock_init(dio-bio_lock);
dio-refcount = 1;
-   dio-bio_list = NULL;
-   dio-waiter = NULL;
 
/*
 * In case of non-aligned buffers, we may need 2 more
@@ -995,8 +981,6 @@ direct_io_worker(int rw, struct kiocb *iocb, struct inode 
*inode,
 */
if (unlikely(dio-blkfactor))
dio-pages_in_io = 2;
-   else
-   dio-pages_in_io = 0;
 
for (seg = 0; seg  nr_segs; seg++) {
user_addr = (unsigned long)iov[seg].iov_base;
@@ -1184,7 +1168,7 @@ __blockdev_direct_IO(int rw, struct kiocb *iocb, struct 
inode *inode,
}
}
 
-   dio = kmalloc(sizeof(*dio), GFP_KERNEL);
+   dio = kzalloc(sizeof(*dio), GFP_KERNEL);
retval = -ENOMEM;
if (!dio)
goto out;
-
To unsubscribe from this list: send the line unsubscribe git-commits-head in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html