From 22e855ce2946911da6f180c09626375cbbce999e Mon Sep 17 00:00:00 2001 From: Greg Kroah-Hartman Date: Wed, 4 Feb 2009 08:55:08 -0800 Subject: [PATCH] .27 patches --- ...etlk-before-copying-conflicting-lock.patch | 41 ++++++++++ ...ta_nv-ck804-has-borked-hardreset-too.patch | 42 ++++++++++ .../sata_nv-rename-nv_nf2_hardreset.patch | 80 +++++++++++++++++++ queue-2.6.27/series | 3 + 4 files changed, 166 insertions(+) create mode 100644 queue-2.6.27/dlm-initialize-file_lock-struct-in-getlk-before-copying-conflicting-lock.patch create mode 100644 queue-2.6.27/sata_nv-ck804-has-borked-hardreset-too.patch create mode 100644 queue-2.6.27/sata_nv-rename-nv_nf2_hardreset.patch diff --git a/queue-2.6.27/dlm-initialize-file_lock-struct-in-getlk-before-copying-conflicting-lock.patch b/queue-2.6.27/dlm-initialize-file_lock-struct-in-getlk-before-copying-conflicting-lock.patch new file mode 100644 index 00000000000..cca503732cf --- /dev/null +++ b/queue-2.6.27/dlm-initialize-file_lock-struct-in-getlk-before-copying-conflicting-lock.patch @@ -0,0 +1,41 @@ +From 20d5a39929232a715f29e6cb7e3f0d0c790f41eb Mon Sep 17 00:00:00 2001 +From: Jeff Layton +Date: Wed, 21 Jan 2009 11:34:50 -0500 +Subject: dlm: initialize file_lock struct in GETLK before copying conflicting lock + +From: Jeff Layton + +commit 20d5a39929232a715f29e6cb7e3f0d0c790f41eb upstream. + +dlm_posix_get fills out the relevant fields in the file_lock before +returning when there is a lock conflict, but doesn't clean out any of +the other fields in the file_lock. + +When nfsd does a NFSv4 lockt call, it sets the fl_lmops to +nfsd_posix_mng_ops before calling the lower fs. When the lock comes back +after testing a lock on GFS2, it still has that field set. This confuses +nfsd into thinking that the file_lock is a nfsd4 lock. + +Fix this by making DLM reinitialize the file_lock before copying the +fields from the conflicting lock. + +Signed-off-by: Jeff Layton +Signed-off-by: David Teigland +Signed-off-by: Greg Kroah-Hartman + +--- + fs/dlm/plock.c | 2 ++ + 1 file changed, 2 insertions(+) + +--- a/fs/dlm/plock.c ++++ b/fs/dlm/plock.c +@@ -304,7 +304,9 @@ int dlm_posix_get(dlm_lockspace_t *locks + if (rv == -ENOENT) + rv = 0; + else if (rv > 0) { ++ locks_init_lock(fl); + fl->fl_type = (op->info.ex) ? F_WRLCK : F_RDLCK; ++ fl->fl_flags = FL_POSIX; + fl->fl_pid = op->info.pid; + fl->fl_start = op->info.start; + fl->fl_end = op->info.end; diff --git a/queue-2.6.27/sata_nv-ck804-has-borked-hardreset-too.patch b/queue-2.6.27/sata_nv-ck804-has-borked-hardreset-too.patch new file mode 100644 index 00000000000..a3239786414 --- /dev/null +++ b/queue-2.6.27/sata_nv-ck804-has-borked-hardreset-too.patch @@ -0,0 +1,42 @@ +From 8d993eaa9c3c61b8a5929a7f695078a1fcfb4869 Mon Sep 17 00:00:00 2001 +From: Tejun Heo +Date: Sun, 1 Feb 2009 10:56:31 +0900 +Subject: sata_nv: ck804 has borked hardreset too + +From: Tejun Heo + +commit 8d993eaa9c3c61b8a5929a7f695078a1fcfb4869 upstream. + +While playing with nvraid, I found out that rmmoding and insmoding +often trigger hardreset failure on the first port (the second one was +always okay). Seriously, how diverse can you get with hardreset +behaviors? Anyways, make ck804 use noclassify variant too. + +Signed-off-by: Tejun Heo +Signed-off-by: Jeff Garzik +Signed-off-by: Greg Kroah-Hartman + +--- + drivers/ata/sata_nv.c | 7 ++++++- + 1 file changed, 6 insertions(+), 1 deletion(-) + +--- a/drivers/ata/sata_nv.c ++++ b/drivers/ata/sata_nv.c +@@ -436,11 +436,16 @@ static struct ata_port_operations nv_nf2 + .hardreset = nv_noclassify_hardreset, + }; + +-/* CK804 finally gets hardreset right */ ++/* For initial probing after boot and hot plugging, hardreset mostly ++ * works fine on CK804 but curiously, reprobing on the initial port by ++ * rescanning or rmmod/insmod fails to acquire the initial D2H Reg FIS ++ * in somewhat undeterministic way. Use noclassify hardreset. ++ */ + static struct ata_port_operations nv_ck804_ops = { + .inherits = &nv_common_ops, + .freeze = nv_ck804_freeze, + .thaw = nv_ck804_thaw, ++ .hardreset = nv_noclassify_hardreset, + .host_stop = nv_ck804_host_stop, + }; + diff --git a/queue-2.6.27/sata_nv-rename-nv_nf2_hardreset.patch b/queue-2.6.27/sata_nv-rename-nv_nf2_hardreset.patch new file mode 100644 index 00000000000..ebaac51f41c --- /dev/null +++ b/queue-2.6.27/sata_nv-rename-nv_nf2_hardreset.patch @@ -0,0 +1,80 @@ +From e8caa3c70e94d867ca2efe9e53fd388b52d6d0c8 Mon Sep 17 00:00:00 2001 +From: Tejun Heo +Date: Sun, 25 Jan 2009 11:25:22 +0900 +Subject: sata_nv: rename nv_nf2_hardreset() + +From: Tejun Heo + +commit e8caa3c70e94d867ca2efe9e53fd388b52d6d0c8 upstream. + +nv_nf2_hardreset() will be used by other flavors too. Rename it to +nv_noclassify_hardreset(). + +Signed-off-by: Tejun Heo +Signed-off-by: Jeff Garzik +Signed-off-by: Greg Kroah-Hartman + +--- + drivers/ata/sata_nv.c | 28 ++++++++++++++-------------- + 1 file changed, 14 insertions(+), 14 deletions(-) + +--- a/drivers/ata/sata_nv.c ++++ b/drivers/ata/sata_nv.c +@@ -305,10 +305,10 @@ static irqreturn_t nv_ck804_interrupt(in + static int nv_scr_read(struct ata_port *ap, unsigned int sc_reg, u32 *val); + static int nv_scr_write(struct ata_port *ap, unsigned int sc_reg, u32 val); + ++static int nv_noclassify_hardreset(struct ata_link *link, unsigned int *class, ++ unsigned long deadline); + static void nv_nf2_freeze(struct ata_port *ap); + static void nv_nf2_thaw(struct ata_port *ap); +-static int nv_nf2_hardreset(struct ata_link *link, unsigned int *class, +- unsigned long deadline); + static void nv_ck804_freeze(struct ata_port *ap); + static void nv_ck804_thaw(struct ata_port *ap); + static int nv_adma_slave_config(struct scsi_device *sdev); +@@ -432,7 +432,7 @@ static struct ata_port_operations nv_nf2 + .inherits = &nv_common_ops, + .freeze = nv_nf2_freeze, + .thaw = nv_nf2_thaw, +- .hardreset = nv_nf2_hardreset, ++ .hardreset = nv_noclassify_hardreset, + }; + + /* CK804 finally gets hardreset right */ +@@ -1530,6 +1530,17 @@ static int nv_scr_write(struct ata_port + return 0; + } + ++static int nv_noclassify_hardreset(struct ata_link *link, unsigned int *class, ++ unsigned long deadline) ++{ ++ bool online; ++ int rc; ++ ++ rc = sata_link_hardreset(link, sata_deb_timing_hotplug, deadline, ++ &online, NULL); ++ return online ? -EAGAIN : rc; ++} ++ + static void nv_nf2_freeze(struct ata_port *ap) + { + void __iomem *scr_addr = ap->host->ports[0]->ioaddr.scr_addr; +@@ -1554,17 +1565,6 @@ static void nv_nf2_thaw(struct ata_port + iowrite8(mask, scr_addr + NV_INT_ENABLE); + } + +-static int nv_nf2_hardreset(struct ata_link *link, unsigned int *class, +- unsigned long deadline) +-{ +- bool online; +- int rc; +- +- rc = sata_link_hardreset(link, sata_deb_timing_hotplug, deadline, +- &online, NULL); +- return online ? -EAGAIN : rc; +-} +- + static void nv_ck804_freeze(struct ata_port *ap) + { + void __iomem *mmio_base = ap->host->iomap[NV_MMIO_BAR]; diff --git a/queue-2.6.27/series b/queue-2.6.27/series index 1729b72ac19..9dae21b5f72 100644 --- a/queue-2.6.27/series +++ b/queue-2.6.27/series @@ -12,7 +12,9 @@ net-fix-packet-socket-delivery-in-rx-irq-handler.patch nfsd-ensure-nfsv4-calls-the-underlying-filesystem-on-lockt.patch nfsd-only-set-file_lock.fl_lmops-in-nfsd4_lockt-if-a-stateowner-is-found.patch pci-irq-and-pci_ids-patch-for-intel-tigerpoint-deviceids.patch +sata_nv-rename-nv_nf2_hardreset.patch sata_nv-fix-mcp5x-reset.patch +sata_nv-ck804-has-borked-hardreset-too.patch usb-isp1760-fix-probe-in-pci-glue-code.patch x86-fix-page-attribute-corruption-with-cpa.patch cpuidle-update-the-last_state-acpi-cpuidle-reflecting-actual-state-entered.patch @@ -34,3 +36,4 @@ don-t-load-asus-acpi-if-model-is-not-supported.patch newly-inserted-battery-might-differ-from-one-just-removed-so.patch acpi-do-not-modify-sci_en-directly.patch acpi-suspend-blacklist-hp-xw4600-workstation-for-old-code-ordering.patch +dlm-initialize-file_lock-struct-in-getlk-before-copying-conflicting-lock.patch -- 2.47.3