2.6.23-stable review
Subsystems (17)
cover 2.6.23-stable review
This is the start of the stable review cycle for the 2.6.23.9 release. There are 29 patches in this series, all will be posted as a response to this one. If anyone has any issues with these being applied, please let us know. If anyone is a maintainer of the proper subsystem, and wants to add a Signed-off-by: line to the patch, please respond with it.
I would especially like people who experienced the softlockup messages in their kernel logs on 2.6.23.8 to test this series to make sure that everything is now working properly.
These patches are sent out with a number of different people on the Cc:
line. If you wish to be a reviewer, please email [email protected] to add your name to the list. If you want to be off the reviewer list, also email us.
Responses should be made by Friday, Nov 23, 00:00:00 UTC. Anything received after that time might be too late.
thanks,
greg k-h
PATCH 1/29 i2c-pasemi: Fix NACK detection
2.6.23-stable review patch. If anyone has any objections, please let us know.
------------------
From: Jean Delvare <[email protected]>
patch be8a1f7cd4501c3b4b32543577a33aee6d2193ac in mainline.
Turns out we don't actually check the status to see if there was a device out there to talk to, just if we had a timeout when doing so.
Add the proper check, so we don't falsly think there are devices on the bus that are not there, etc.
--- drivers/i2c/busses/i2c-pasemi.c | 5 +++++ 1 file changed, 5 insertions(+)
drivers/i2c/busses/i2c-pasemi.c +5 -0
@@ -51,6 +51,7 @@ struct pasemi_smbus {#define MRXFIFO_DATA_M 0x000000ff#define SMSTA_XEN 0x08000000 +#define SMSTA_MTN 0x00200000#define CTL_MRR 0x00000400#define CTL_MTR 0x00000200
@@ -98,6 +99,10 @@ static unsigned int pasemi_smb_waitready status =reg_read (smbus,REG_SMSTA ); } +/* Got NACK? */ +if (status &SMSTA_MTN ) +return -ENXIO ; +if (timeout <0 ) {dev_warn (&smbus->dev->dev,"Timeout, status 0x%08x\n" , status);reg_write (smbus,REG_SMSTA , status);
PATCH 2/29 i2c/eeprom: Recognize VGN as a valid Sony Vaio name prefix
In reply to Greg Kroah-Hartman2.6.23-stable review patch. If anyone has any objections, please let us know.
------------------
From: Jean Delvare <[email protected]>
patch 8b925a3dd8a4d7451092cb9aa11da727ba69e0f0 in mainline.
Recent (i.e. 2005 and later) Sony Vaio laptops have names beginning with VGN rather than PCG. Update the eeprom driver so that it recognizes these.
Why this matters: the eeprom driver hides private data from the EEPROMs it recognizes as Vaio EEPROMs (passwords, serial number...) so if the driver fails to recognize a Vaio EEPROM as such, the private data is exposed to the world.
--- drivers/i2c/chips/eeprom.c | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-)
drivers/i2c/chips/eeprom.c +9 -5
@@ -197,12 +197,16 @@ static int eeprom_detect(struct i2c_adap goto exit_kfree;/* Detect the Vaio nature of EEPROMs. -We use the "PCG-" prefix as the signature. */ +We use the "PCG-" or "VGN-" prefix as the signature. */ if (address ==0x57 ) { -if (i2c_smbus_read_byte_data (new_client,0x80 ) =='P' - &&i2c_smbus_read_byte (new_client) =='C' - &&i2c_smbus_read_byte (new_client) =='G' - &&i2c_smbus_read_byte (new_client) =='-' ) { +char name[4 ]; + + name[0 ] =i2c_smbus_read_byte_data (new_client,0x80 ); + name[1 ] =i2c_smbus_read_byte (new_client); + name[2 ] =i2c_smbus_read_byte (new_client); + name[3 ] =i2c_smbus_read_byte (new_client); + +if (!memcmp (name,"PCG-" ,4 ) || !memcmp (name,"VGN-" ,4 )) {dev_info (&new_client->dev,"Vaio EEPROM detected, " "enabling password protection\n" ); data->nature =VAIO ;
PATCH 3/29 i2c/eeprom: Hide Sony Vaio serial numbers
In reply to Greg Kroah-Hartman2.6.23-stable review patch. If anyone has any objections, please let us know.
------------------
From: Jean Delvare <[email protected]>
patch 0f2cbd38aa377e30df3b7602abed69464d1970aa in mainline.
The sysfs interface to DMI data takes care to not make the system serial number and UUID world-readable, presumably due to privacy concerns. For consistency, we should not let the eeprom driver export these same strings to the world on Sony Vaio laptops. Instead, only make them readable by root, as we already do for BIOS passwords.
--- drivers/i2c/chips/eeprom.c | 23 +++++++++++++++-------- 1 file changed, 15 insertions(+), 8 deletions(-)
drivers/i2c/chips/eeprom.c +15 -8
@@ -128,13 +128,20 @@ static ssize_t eeprom_read(struct kobjecfor (slice = off >>5 ; slice <= (off + count -1 ) >>5 ; slice++)eeprom_update_client (client, slice); -/* Hide Vaio security settings to regular users (16 first bytes) */ -if (data->nature ==VAIO && off <16 && !capable (CAP_SYS_ADMIN )) { -size_t in_row1 =16 - off; - in_row1 =min (in_row1, count); -memset (buf,0 , in_row1); -if (count - in_row1 >0 ) -memcpy (buf + in_row1, &data->data[16 ], count - in_row1); +/* Hide Vaio private settings to regular users: +- BIOS passwords: bytes 0x00 to 0x0f +- UUID: bytes 0x10 to 0x1f +- Serial number: 0xc0 to 0xdf */ +if (data->nature ==VAIO && !capable (CAP_SYS_ADMIN )) { +int i; + +for (i =0 ; i < count; i++) { +if ((off + i <=0x1f ) || + (off + i >=0xc0 && off + i <=0xdf )) + buf[i] =0 ; +else + buf[i] = data->data[off + i]; + } }else {memcpy (buf, &data->data[off], count); }
@@ -208,7 +215,7 @@ static int eeprom_detect(struct i2c_adapif (!memcmp (name,"PCG-" ,4 ) || !memcmp (name,"VGN-" ,4 )) {dev_info (&new_client->dev,"Vaio EEPROM detected, " -"enabling password protection\n" ); +"enabling privacy protection\n" ); data->nature =VAIO ; } }
PATCH 4/29 drivers/video/ps3fb: fix memset size error
In reply to Greg Kroah-Hartman2.6.23-stable review patch. If anyone has any objections, please let us know.
------------------
From: Li Zefan <[email protected]>
patch 3cc2c17700c98b0af778566b0af6292b23b01430 in mainline.
The size passing to memset is wrong.
Signed-off-by Li Zefan <[email protected]>
--- drivers/video/ps3fb.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/video/ps3fb.c +1 -1
@@ -659,7 +659,7 @@ static int ps3fb_blank(int blank, structstatic int ps3fb_get_vblank (struct fb_vblank *vblank) { -memset (vblank,0 ,sizeof (&vblank)); +memset (vblank,0 ,sizeof (*vblank)); vblank->flags =FB_VBLANK_HAVE_VSYNC ;return 0 ; }
PATCH 5/29 oProfile: oops when profile_pc() returns ~0LU
In reply to Greg Kroah-Hartman2.6.23-stable review patch. If anyone has any objections, please let us know.
------------------
From: Philippe Elie <[email protected]>
patch df9d177aa28d50e64bae6fbd6b263833079e3571 in mainline.
Instruction pointer returned by profile_pc() can be a random value. This break the assumption than we can safely set struct op_sample.eip field to a magic value to signal to the per-cpu buffer reader side special event like task switch ending up in a segfault in get_task_mm() when profile_pc() return ~0UL. Fixed by sanitizing the sampled eip and reject/log invalid eip.
Problem reported by Sami Farin, patch tested by him.
--- drivers/oprofile/cpu_buffer.c | 7 +++++++ drivers/oprofile/cpu_buffer.h | 1 + drivers/oprofile/oprofile_stats.c | 4 ++++ 3 files changed, 12 insertions(+)
drivers/oprofile/cpu_buffer.c +7 -0
@@ -64,6 +64,8 @@ int alloc_cpu_buffers(void) b->head_pos =0 ; b->sample_received =0 ; b->sample_lost_overflow =0 ; + b->backtrace_aborted =0 ; + b->sample_invalid_eip =0 ; b->cpu = i;INIT_DELAYED_WORK (&b->work, wq_sync_buffer); }
@@ -175,6 +177,11 @@ static int log_sample(struct oprofile_cp cpu_buf->sample_received++; +if (pc ==ESCAPE_CODE ) { + cpu_buf->sample_invalid_eip++; +return 0 ; + } +if (nr_available_slots (cpu_buf) <3 ) { cpu_buf->sample_lost_overflow++;return 0 ;
drivers/oprofile/cpu_buffer.h +1 -0
@@ -42,6 +42,7 @@ struct oprofile_cpu_buffer {unsigned long sample_received;unsigned long sample_lost_overflow;unsigned long backtrace_aborted; +unsigned long sample_invalid_eip;int cpu;struct delayed_work work; }____cacheline_aligned ;
drivers/oprofile/oprofile_stats.c +4 -0
@@ -26,6 +26,8 @@ void oprofile_reset_stats(void) cpu_buf = &cpu_buffer[i]; cpu_buf->sample_received =0 ; cpu_buf->sample_lost_overflow =0 ; + cpu_buf->backtrace_aborted =0 ; + cpu_buf->sample_invalid_eip =0 ; }atomic_set (&oprofile_stats.sample_lost_no_mm,0 );
@@ -61,6 +63,8 @@ void oprofile_create_stats_files(struct &cpu_buf->sample_lost_overflow);oprofilefs_create_ro_ulong (sb, cpudir,"backtrace_aborted" , &cpu_buf->backtrace_aborted); +oprofilefs_create_ro_ulong (sb, cpudir,"sample_invalid_eip" , + &cpu_buf->sample_invalid_eip); } oprofilefs_create_ro_atomic(sb, dir, "sample_lost_no_mm",
PATCH 6/29 raid5: fix unending write sequence
In reply to Greg Kroah-Hartman2.6.23-stable review patch. If anyone has any objections, please let us know.
------------------
From: Dan Williams <[email protected]>
patch 6c55be8b962f1bdc592d579e81fc27b11ea53dfc in mainline.
<debug output from Joel's system>
handling stripe 7629696, state=0x14 cnt=1, pd_idx=2 ops=0:0:0
check 5: state 0x6 toread 0000000000000000 read 0000000000000000 write fffff800ffcffcc0 written 0000000000000000 check 4: state 0x6 toread 0000000000000000 read 0000000000000000 write fffff800fdd4e360 written 0000000000000000 check 3: state 0x1 toread 0000000000000000 read 0000000000000000 write 0000000000000000 written 0000000000000000 check 2: state 0x1 toread 0000000000000000 read 0000000000000000 write 0000000000000000 written 0000000000000000 check 1: state 0x6 toread 0000000000000000 read 0000000000000000 write fffff800ff517e40 written 0000000000000000 check 0: state 0x6 toread 0000000000000000 read 0000000000000000 write fffff800fd4cae60 written 0000000000000000 locked=4 uptodate=2 to_read=0 to_write=4 failed=0 failed_num=0
for sector 7629696, rmw=0 rcw=0
</debug>
These blocks were prepared to be written out, but were never handled in ops_run_biodrain(), so they remain locked forever. The operations flags are all clear which means handle_stripe() thinks nothing else needs to be done.
This state suggests that the STRIPE_OP_PREXOR bit was sampled 'set' when it should not have been. This patch cleans up cases where the code looks at sh->ops.pending when it should be looking at the consistent stack-based snapshot of the operations flags.
Report from Joel:
Resync done. Patch fix this bug.
--- drivers/md/raid5.c | 16 +++++++++------- 1 file changed, 9 insertions(+), 7 deletions(-)
drivers/md/raid5.c +9 -7
@@ -689,7 +689,8 @@ ops_run_prexor(struct stripe_head *sh, s }static struct dma_async_tx_descriptor * -ops_run_biodrain (struct stripe_head *sh,struct dma_async_tx_descriptor *tx) +ops_run_biodrain (struct stripe_head *sh,struct dma_async_tx_descriptor *tx, +unsigned long pending) {int disks = sh->disks;int pd_idx = sh->pd_idx, i;
@@ -697,7 +698,7 @@ ops_run_biodrain(struct stripe_head *sh,/* check if prexor is active which means only process blocks * that are part of a read-modify-write (Wantprexor) */ -int prexor =test_bit (STRIPE_OP_PREXOR , &sh->ops.pending); +int prexor =test_bit (STRIPE_OP_PREXOR , &pending);pr_debug ("%s: stripe %llu\n" , __FUNCTION__, (unsigned long long )sh->sector);
@@ -774,7 +775,8 @@ static void ops_complete_write(void *str }static void -ops_run_postxor (struct stripe_head *sh,struct dma_async_tx_descriptor *tx) +ops_run_postxor (struct stripe_head *sh,struct dma_async_tx_descriptor *tx, +unsigned long pending) {/* kernel stack size limits the total number of disks */ int disks = sh->disks;
@@ -782,7 +784,7 @@ ops_run_postxor(struct stripe_head *sh,int count =0 , pd_idx = sh->pd_idx, i;struct page *xor_dest; -int prexor =test_bit (STRIPE_OP_PREXOR , &sh->ops.pending); +int prexor =test_bit (STRIPE_OP_PREXOR , &pending);unsigned long flags;dma_async_tx_callback callback;
@@ -809,7 +811,7 @@ ops_run_postxor(struct stripe_head *sh, }/* check whether this postxor is part of a write */ - callback =test_bit (STRIPE_OP_BIODRAIN , &sh->ops.pending) ? + callback =test_bit (STRIPE_OP_BIODRAIN , &pending) ? ops_complete_write : ops_complete_postxor;/* 1/ if we prexor'd then the dest is reused as a source
@@ -897,12 +899,12 @@ static void raid5_run_ops(struct stripe_ tx =ops_run_prexor (sh, tx);if (test_bit (STRIPE_OP_BIODRAIN , &pending)) { - tx =ops_run_biodrain (sh, tx); + tx =ops_run_biodrain (sh, tx, pending); overlap_clear++; }if (test_bit (STRIPE_OP_POSTXOR , &pending)) -ops_run_postxor (sh, tx); +ops_run_postxor (sh, tx, pending);if (test_bit (STRIPE_OP_CHECK , &pending))ops_run_check (sh);
PATCH 7/29 knfsd: fix spurious EINVAL errors on first access of new filesystem
In reply to Greg Kroah-Hartman2.6.23-stable review patch. If anyone has any objections, please let us know.
------------------
From: J. Bruce Fields <[email protected]>
patch ac8587dcb58e40dd336d99d60f852041e06cc3dd in mainline.
The v2/v3 acl code in nfsd is translating any return from fh_verify() to nfserr_inval. This is particularly unfortunate in the case of an nfserr_dropit return, which is an internal error meant to indicate to callers that this request has been deferred and should just be dropped pending the results of an upcall to mountd.
Thanks to Roland <devzero-S0/[email protected]> for bug report and data collection.
--- fs/nfsd/nfs2acl.c | 2 +- fs/nfsd/nfs3acl.c | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-)
fs/nfsd/nfs2acl.c +1 -1
@@ -41,7 +41,7 @@ static __be32 nfsacld_proc_getacl(struct fh =fh_copy (&resp->fh, &argp->fh);if ((nfserr =fh_verify (rqstp, &resp->fh,0 ,MAY_NOP ))) -RETURN_STATUS (nfserr_inval); +RETURN_STATUS (nfserr);if (argp->mask & ~(NFS_ACL |NFS_ACLCNT |NFS_DFACL |NFS_DFACLCNT ))RETURN_STATUS (nfserr_inval);
fs/nfsd/nfs3acl.c +1 -1
@@ -37,7 +37,7 @@ static __be32 nfsd3_proc_getacl(struct s fh =fh_copy (&resp->fh, &argp->fh);if ((nfserr =fh_verify (rqstp, &resp->fh,0 ,MAY_NOP ))) -RETURN_STATUS (nfserr_inval); +RETURN_STATUS (nfserr);if (argp->mask & ~(NFS_ACL |NFS_ACLCNT |NFS_DFACL |NFS_DFACLCNT ))RETURN_STATUS (nfserr_inval);
Signature · 11 lines
------------------------------------------------------------------------- This SF.net email is sponsored by: Microsoft Defy all challenges. Microsoft(R) Visual Studio 2005. http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/ _______________________________________________ NFS maillist - [email protected] https://lists.sourceforge.net/lists/listinfo/nfs _______________________________________________ Please note that [email protected] is being discontinued. Please subscribe to [email protected] instead. http://vger.kernel.org/vger-lists.html#linux-nfs
PATCH 7/29 knfsd: fix spurious EINVAL errors on first access of new filesystem
In reply to Greg Kroah-Hartman2.6.23-stable review patch. If anyone has any objections, please let us know.
------------------
From: J. Bruce Fields <[email protected]>
patch ac8587dcb58e40dd336d99d60f852041e06cc3dd in mainline.
The v2/v3 acl code in nfsd is translating any return from fh_verify() to nfserr_inval. This is particularly unfortunate in the case of an nfserr_dropit return, which is an internal error meant to indicate to callers that this request has been deferred and should just be dropped pending the results of an upcall to mountd.
Thanks to Roland <[email protected]> for bug report and data collection.
--- fs/nfsd/nfs2acl.c | 2 +- fs/nfsd/nfs3acl.c | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-)
fs/nfsd/nfs2acl.c +1 -1
@@ -41,7 +41,7 @@ static __be32 nfsacld_proc_getacl(struct fh =fh_copy (&resp->fh, &argp->fh);if ((nfserr =fh_verify (rqstp, &resp->fh,0 ,MAY_NOP ))) -RETURN_STATUS (nfserr_inval); +RETURN_STATUS (nfserr);if (argp->mask & ~(NFS_ACL |NFS_ACLCNT |NFS_DFACL |NFS_DFACLCNT ))RETURN_STATUS (nfserr_inval);
fs/nfsd/nfs3acl.c +1 -1
@@ -37,7 +37,7 @@ static __be32 nfsd3_proc_getacl(struct s fh =fh_copy (&resp->fh, &argp->fh);if ((nfserr =fh_verify (rqstp, &resp->fh,0 ,MAY_NOP ))) -RETURN_STATUS (nfserr_inval); +RETURN_STATUS (nfserr);if (argp->mask & ~(NFS_ACL |NFS_ACLCNT |NFS_DFACL |NFS_DFACLCNT ))RETURN_STATUS (nfserr_inval);
PATCH 8/29 nfsd4: recheck for secure ports in fh_verify
In reply to Greg Kroah-Hartman2.6.23-stable review patch. If anyone has any objections, please let us know.
------------------
From: J. Bruce Fields <[email protected]>
patch 6fa02839bf9412e18e773d04e96182b4cd0b5d57 in mainline.
As with
7fc90ec93a5eb71f4b08... "call nfsd_setuser() on fh_compose()..."
this is a case where we need to redo a security check in fh_verify() even though the filehandle already has an associated dentry--if the filehandle was created by fh_compose() in an earlier operation of the nfsv4 compound, then we may not have done these checks yet.
Without this fix it is possible, for example, to traverse from an export without the secure ports requirement to one with it in a single compound, and bypass the secure port check on the new export.
While we're here, fix up some minor style problems and change a printk() to a dprintk(), to make it harder for random unprivileged users to spam the logs.
--- fs/nfsd/nfsfh.c | 43 ++++++++++++++++++++++++++----------------- 1 file changed, 26 insertions(+), 17 deletions(-)
fs/nfsd/nfsfh.c +26 -17
@@ -95,6 +95,22 @@ nfsd_mode_check(struct svc_rqst *rqstp,return 0 ; } +static __be32 nfsd_setuser_and_check_port (struct svc_rqst *rqstp, +struct svc_export *exp) +{ +/* Check if the request originated from a secure port. */ +if (!rqstp->rq_secure &&EX_SECURE (exp)) { +char buf[RPC_MAX_ADDRBUFLEN ]; +dprintk (KERN_WARNING +"nfsd: request from insecure port %s!\n" , +svc_print_addr (rqstp, buf,sizeof (buf))); +return nfserr_perm; + } + +/* Set user creds for this exportpoint */ +return nfserrno (nfsd_setuser (rqstp, exp)); +} +/* * Perform sanity checks on the dentry in a client's file handle. *
@@ -167,18 +183,7 @@ fh_verify(struct svc_rqst *rqstp, struct goto out; } -/* Check if the request originated from a secure port. */ - error = nfserr_perm; -if (!rqstp->rq_secure &&EX_SECURE (exp)) { -char buf[RPC_MAX_ADDRBUFLEN ]; -printk (KERN_WARNING -"nfsd: request from insecure port %s!\n" , -svc_print_addr (rqstp, buf,sizeof (buf))); - goto out; - } - -/* Set user creds for this exportpoint */ - error =nfserrno (nfsd_setuser (rqstp, exp)); + error =nfsd_setuser_and_check_port (rqstp, exp);if (error) goto out;
@@ -227,18 +232,22 @@ fh_verify(struct svc_rqst *rqstp, struct fhp->fh_export = exp; nfsd_nr_verified++; }else { -/* just rechecking permissions -* (e.g. nfsproc_create calls fh_verify, then nfsd_create does as well) +/* +* just rechecking permissions +* (e.g. nfsproc_create calls fh_verify, then nfsd_create +* does as well) */ dprintk ("nfsd: fh_verify - just checking\n" ); dentry = fhp->fh_dentry; exp = fhp->fh_export; -/* Set user creds for this exportpoint; necessary even +/* +* Set user creds for this exportpoint; necessary even * in the "just checking" case because this may be a * filehandle that was created by fh_compose, and that * is about to be used in another nfsv4 compound -* operation */ - error =nfserrno (nfsd_setuser (rqstp, exp)); +* operation. +*/ + error =nfsd_setuser_and_check_port (rqstp, exp);if (error) goto out; }
Signature · 11 lines
------------------------------------------------------------------------- This SF.net email is sponsored by: Microsoft Defy all challenges. Microsoft(R) Visual Studio 2005. http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/ _______________________________________________ NFS maillist - [email protected] https://lists.sourceforge.net/lists/listinfo/nfs _______________________________________________ Please note that [email protected] is being discontinued. Please subscribe to [email protected] instead. http://vger.kernel.org/vger-lists.html#linux-nfs
PATCH 8/29 nfsd4: recheck for secure ports in fh_verify
In reply to Greg Kroah-Hartman2.6.23-stable review patch. If anyone has any objections, please let us know.
------------------
From: J. Bruce Fields <[email protected]>
patch 6fa02839bf9412e18e773d04e96182b4cd0b5d57 in mainline.
As with
7fc90ec93a5eb71f4b08... "call nfsd_setuser() on fh_compose()..."
this is a case where we need to redo a security check in fh_verify() even though the filehandle already has an associated dentry--if the filehandle was created by fh_compose() in an earlier operation of the nfsv4 compound, then we may not have done these checks yet.
Without this fix it is possible, for example, to traverse from an export without the secure ports requirement to one with it in a single compound, and bypass the secure port check on the new export.
While we're here, fix up some minor style problems and change a printk() to a dprintk(), to make it harder for random unprivileged users to spam the logs.
--- fs/nfsd/nfsfh.c | 43 ++++++++++++++++++++++++++----------------- 1 file changed, 26 insertions(+), 17 deletions(-)
fs/nfsd/nfsfh.c +26 -17
@@ -95,6 +95,22 @@ nfsd_mode_check(struct svc_rqst *rqstp,return 0 ; } +static __be32 nfsd_setuser_and_check_port (struct svc_rqst *rqstp, +struct svc_export *exp) +{ +/* Check if the request originated from a secure port. */ +if (!rqstp->rq_secure &&EX_SECURE (exp)) { +char buf[RPC_MAX_ADDRBUFLEN ]; +dprintk (KERN_WARNING +"nfsd: request from insecure port %s!\n" , +svc_print_addr (rqstp, buf,sizeof (buf))); +return nfserr_perm; + } + +/* Set user creds for this exportpoint */ +return nfserrno (nfsd_setuser (rqstp, exp)); +} +/* * Perform sanity checks on the dentry in a client's file handle. *
@@ -167,18 +183,7 @@ fh_verify(struct svc_rqst *rqstp, struct goto out; } -/* Check if the request originated from a secure port. */ - error = nfserr_perm; -if (!rqstp->rq_secure &&EX_SECURE (exp)) { -char buf[RPC_MAX_ADDRBUFLEN ]; -printk (KERN_WARNING -"nfsd: request from insecure port %s!\n" , -svc_print_addr (rqstp, buf,sizeof (buf))); - goto out; - } - -/* Set user creds for this exportpoint */ - error =nfserrno (nfsd_setuser (rqstp, exp)); + error =nfsd_setuser_and_check_port (rqstp, exp);if (error) goto out;
@@ -227,18 +232,22 @@ fh_verify(struct svc_rqst *rqstp, struct fhp->fh_export = exp; nfsd_nr_verified++; }else { -/* just rechecking permissions -* (e.g. nfsproc_create calls fh_verify, then nfsd_create does as well) +/* +* just rechecking permissions +* (e.g. nfsproc_create calls fh_verify, then nfsd_create +* does as well) */ dprintk ("nfsd: fh_verify - just checking\n" ); dentry = fhp->fh_dentry; exp = fhp->fh_export; -/* Set user creds for this exportpoint; necessary even +/* +* Set user creds for this exportpoint; necessary even * in the "just checking" case because this may be a * filehandle that was created by fh_compose, and that * is about to be used in another nfsv4 compound -* operation */ - error =nfserrno (nfsd_setuser (rqstp, exp)); +* operation. +*/ + error =nfsd_setuser_and_check_port (rqstp, exp);if (error) goto out; }
PATCH 9/29 dmaengine: fix broken device refcounting
In reply to Greg Kroah-Hartman2.6.23-stable review patch. If anyone has any objections, please let us know.
------------------
From: Haavard Skinnemoen <[email protected]>
patch 348badf1e825323c419dd118f65783db0f7d2ec8 in mainline.
When a DMA device is unregistered, its reference count is decremented twice for each channel: Once dma_class_dev_release() and once in dma_chan_cleanup(). This may result in the DMA device driver's remove() function completing before all channels have been cleaned up, causing lots of use-after-free fun.
Fix it by incrementing the device's reference count twice for each channel during registration.
--- drivers/dma/dmaengine.c | 17 ++++++----------- 1 file changed, 6 insertions(+), 11 deletions(-)
drivers/dma/dmaengine.c +6 -11
@@ -182,10 +182,9 @@ static void dma_client_chan_alloc(struct/* we are done once this client rejects * an available resource */ -if (ack ==DMA_ACK ) { +if (ack ==DMA_ACK )dma_chan_get (chan); -kref_get (&device->refcount); - }else if (ack ==DMA_NAK ) +else if (ack ==DMA_NAK )return ; } }
@@ -272,11 +271,8 @@ static void dma_clients_notify_removed(s/* client was holding resources for this channel so * free it */ -if (ack ==DMA_ACK ) { +if (ack ==DMA_ACK )dma_chan_put (chan); -kref_put (&chan->device->refcount, - dma_async_device_cleanup); - } }mutex_unlock (&dma_list_mutex);
@@ -316,11 +312,8 @@ void dma_async_client_unregister(struct ack = client->event_callback (client, chan,DMA_RESOURCE_REMOVED ); -if (ack ==DMA_ACK ) { +if (ack ==DMA_ACK )dma_chan_put (chan); -kref_put (&chan->device->refcount, - dma_async_device_cleanup); - } }list_del (&client->global_node);
@@ -397,6 +390,8 @@ int dma_async_device_register(struct dma goto err_out; } +/* One for the channel, one of the class device */ +kref_get (&device->refcount);kref_get (&device->refcount);kref_init (&chan->refcount); chan->slow_ref =0 ;
PATCH 10/29 x86: disable preemption in delay_tsc()
In reply to Greg Kroah-Hartman2.6.23-stable review patch. If anyone has any objections, please let us know.
------------------
From: Andrew Morton <[email protected]>
patch 35d5d08a085c56f153458c3f5d8ce24123617faf in mainline.
Marin Mitov points out that delay_tsc() can misbehave if it is preempted and rescheduled on a different CPU which has a skewed TSC. Fix it by disabling preemption.
(I assume that the worst-case behaviour here is a stall of 2^32 cycles)
--- arch/i386/lib/delay.c | 3 +++ arch/x86_64/lib/delay.c | 11 +++++++---- 2 files changed, 10 insertions(+), 4 deletions(-)
arch/i386/lib/delay.c +3 -0
@@ -12,6 +12,7 @@#include <linux/module.h> #include <linux/sched.h> +#include <linux/preempt.h> #include <linux/delay.h> #include <asm/processor.h>
@@ -42,11 +43,13 @@ static void delay_tsc(unsigned long loop {unsigned long bclock, now; +preempt_disable ();/* TSC's are per-cpu */ rdtscl (bclock);do {rep_nop ();rdtscl (now); }while ((now-bclock) < loops); +preempt_enable (); }/*
arch/x86_64/lib/delay.c +7 -4
@@ -10,7 +10,9 @@#include <linux/module.h> #include <linux/sched.h> +#include <linux/preempt.h> #include <linux/delay.h> +#include <asm/delay.h> #include <asm/msr.h>
@@ -27,14 +29,15 @@ int read_current_timer(unsigned long *tivoid __delay (unsigned long loops) {unsigned bclock, now; - + +preempt_disable ();/* TSC's are pre-cpu */ rdtscl (bclock); -do - { +do {rep_nop ();rdtscl (now); } -while ((now-bclock) < loops); +while ((now-bclock) < loops); +preempt_enable (); }EXPORT_SYMBOL (__delay);
PATCH 11/29 reiserfs: dont drop PG_dirty when releasing sub-page-sized dirty file
In reply to Greg Kroah-Hartman2.6.23-stable review patch. If anyone has any objections, please let us know.
------------------
From: Fengguang Wu <[email protected]>
patch c06a018fa5362fa9ed0768bd747c0fab26bc8849 in mainline.
This is not a new problem in 2.6.23-git17. 2.6.22/2.6.23 is buggy in the same way.
Reiserfs could accumulate dirty sub-page-size files until umount time. They cannot be synced to disk by pdflush routines or explicit sync' commands. Only umount' can do the trick.
The direct cause is: the dirty page's PG_dirty is wrongly _cleared_.
Call trace: [<ffffffff8027e920>] cancel_dirty_page+0xd0/0xf0 [<ffffffff8816d470>] :reiserfs:reiserfs_cut_from_item+0x660/0x710 [<ffffffff8816d791>] :reiserfs:reiserfs_do_truncate+0x271/0x530 [<ffffffff8815872d>] :reiserfs:reiserfs_truncate_file+0xfd/0x3b0 [<ffffffff8815d3d0>] :reiserfs:reiserfs_file_release+0x1e0/0x340 [<ffffffff802a187c>] __fput+0xcc/0x1b0 [<ffffffff802a1ba6>] fput+0x16/0x20 [<ffffffff8029e676>] filp_close+0x56/0x90 [<ffffffff8029fe0d>] sys_close+0xad/0x110 [<ffffffff8020c41e>] system_call+0x7e/0x83
Fix the bug by removing the cancel_dirty_page() call. Tests show that it causes no bad behaviors on various write sizes.
=== for the patient ===
Here are more detailed demonstrations of the problem.
1) the page has both PG_dirty(D)/PAGECACHE_TAG_DIRTY(d) after being written to; and then only PAGECACHE_TAG_DIRTY(d) remains after the file is closed.
------------------------------ screen 0 ------------------------------ [T0] root /home/wfg# cat > /test/tiny
[T1] hi
[T2] root /home/wfg#
------------------------------ screen 1 ------------------------------ [T1] root /home/wfg# echo /test/tiny > /proc/filecache
[T1] root /home/wfg# cat /proc/filecache
# file /test/tiny
# flags R:referenced A:active M:mmap U:uptodate D:dirty W:writeback O:owner B:buffer d:dirty w:writeback
# idx len state refcnt
0 1 ___UD__Bd_ 2
[T2] root /home/wfg# cat /proc/filecache
# file /test/tiny
# flags R:referenced A:active M:mmap U:uptodate D:dirty W:writeback O:owner B:buffer d:dirty w:writeback
# idx len state refcnt
0 1 ___U___Bd_ 22) note the non-zero 'cancelled_write_bytes' after /tmp/hi is copied.
------------------------------ screen 0 ------------------------------ [T0] root /home/wfg# echo hi > /tmp/hi
[T1] root /home/wfg# cp /tmp/hi /dev/stdin /test
[T2] hi
[T3] root /home/wfg#
------------------------------ screen 1 ------------------------------ [T1] root /proc/4397# cd /proc/pidof cp
[T1] root /proc/4713# cat io
rchar: 8396
wchar: 3
syscr: 20
syscw: 1
read_bytes: 0
write_bytes: 20480
cancelled_write_bytes: 4096
[T2] root /proc/4713# cat io
rchar: 8399
wchar: 6
syscr: 21
syscw: 2
read_bytes: 0
write_bytes: 24576
cancelled_write_bytes: 4096//Question: the 'write_bytes' is a bit more than expected ;-)
--- fs/reiserfs/stree.c | 3 --- 1 file changed, 3 deletions(-)
fs/reiserfs/stree.c +0 -3
@@ -1458,9 +1458,6 @@ static void unmap_buffers(struct page *p } bh = next; }while (bh != head); -if (PAGE_SIZE == bh->b_size) { -cancel_dirty_page (page,PAGE_CACHE_SIZE ); - } } } }
PATCH 12/29 sata_sis: fix SCR read breakage
In reply to Greg Kroah-Hartman2.6.23-stable review patch. If anyone has any objections, please let us know.
------------------
From: Tejun Heo <[email protected]>
patch aaa092a114696f4425cd57c4d7fa05110007e247 in mainline.
sata_sis: fix SCR read breakage
SCR read for controllers which uses PCI configuration space for SCR access got broken while adding @val argument to SCR accessors. Fix it.
--- drivers/ata/sata_sis.c | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-)
drivers/ata/sata_sis.c +8 -5
@@ -168,11 +168,11 @@ static unsigned int get_scr_cfg_addr(strreturn addr; } -static u32 sis_scr_cfg_read (struct ata_port *ap,unsigned int sc_reg) +static u32 sis_scr_cfg_read (struct ata_port *ap,unsigned int sc_reg,u32 *val) {struct pci_dev *pdev =to_pci_dev (ap->host->dev);unsigned int cfg_addr =get_scr_cfg_addr (ap, sc_reg); -u32 val, val2 =0 ; +u32 val2 =0 ;u8 pmr;if (sc_reg ==SCR_ERROR )/* doesn't exist in PCI cfg space */
@@ -180,13 +180,16 @@ static u32 sis_scr_cfg_read (struct ata_pci_read_config_byte (pdev,SIS_PMR , &pmr); -pci_read_config_dword (pdev, cfg_addr, &val); +pci_read_config_dword (pdev, cfg_addr, val);if ((pdev->device ==0x0182 ) || (pdev->device ==0x0183 ) || (pdev->device ==0x1182 ) || (pmr &SIS_PMR_COMBINED ))pci_read_config_dword (pdev, cfg_addr+0x10 , &val2); -return (val|val2) &0xfffffffb ;/* avoid problems with powerdowned ports */ + *val |= val2; + *val &=0xfffffffb ;/* avoid problems with powerdowned ports */ + +return 0 ; }static void sis_scr_cfg_write (struct ata_port *ap,unsigned int sc_reg,u32 val)
@@ -216,7 +219,7 @@ static int sis_scr_read(struct ata_portreturn -EINVAL ;if (ap->flags &SIS_FLAG_CFGSCR ) -return sis_scr_cfg_read (ap, sc_reg); +return sis_scr_cfg_read (ap, sc_reg, val);pci_read_config_byte (pdev,SIS_PMR , &pmr);
PATCH 13/29 libata: sata_sis: use correct S/G table size
In reply to Greg Kroah-Hartman2.6.23-stable review patch. If anyone has any objections, please let us know.
------------------
From: Jeff Garzik <[email protected]>
patch 96af154710d44b574515431a0bb014888398a741 in mainline.
[libata] sata_sis: use correct S/G table size
sata_sis has the same restrictions as other SFF controllers, and so must use LIBATA_MAX_PRD to denote that SCSI may only fill ATA_MAX_PRD/2 entries, due to our need to handle IOMMU merging.
--- drivers/ata/sata_sis.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/ata/sata_sis.c +1 -1
@@ -92,7 +92,7 @@ static struct scsi_host_template sis_sht .queuecommand = ata_scsi_queuecmd, .can_queue = ATA_DEF_QUEUE, .this_id = ATA_SHT_THIS_ID, - .sg_tablesize = ATA_MAX_PRD, + .sg_tablesize = LIBATA_MAX_PRD, .cmd_per_lun = ATA_SHT_CMD_PER_LUN, .emulated = ATA_SHT_EMULATED, .use_clustering = ATA_SHT_USE_CLUSTERING,
PATCH 14/29 ACPI: VIDEO: Adjust current level to closest available one.
In reply to Greg Kroah-Hartman2.6.23-stable review patch. If anyone has any objections, please let us know.
------------------
From: Alexey Starikovskiy <[email protected]>
patch 63f0edfc0b7f8058f9d3f9b572615ec97ae011ba in mainline.
ACPI: VIDEO: Adjust current level to closest available one.
--- drivers/acpi/video.c | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-)
drivers/acpi/video.c +12 -1
@@ -1633,9 +1633,20 @@ static int acpi_video_get_next_level(struct acpi_video_device *device, u32 level_current, u32 event) { - int min, max, min_above, max_below, i, l; + int min, max, min_above, max_below, i, l, delta = 255; max = max_below =0 ; min = min_above =255 ; +/* Find closest level to level_current */ +for (i =0 ; i < device->brightness->count; i++) { + l = device->brightness->levels[i]; +if (abs (l - level_current) <abs (delta)) { + delta = l - level_current; +if (!delta) +break ; + } + } +/* Ajust level_current to closest available level */ + level_current += delta;for (i =0 ; i < device->brightness->count; i++) { l = device->brightness->levels[i];if (l < min)
PATCH 15/29 Fix divide-by-zero in the 2.6.23 scheduler code
In reply to Greg Kroah-Hartman2.6.23-stable review patch. If anyone has any objections, please let us know.
------------------
From: Chuck Ebbert <[email protected]>
No patch in mainline as this logic has been removed from 2.6.24 so it is not necessary.
https://bugzilla.redhat.com/show_bug.cgi?id=340161
The problem code has been removed in 2.6.24. The below patch disables SCHED_FEAT_PRECISE_CPU_LOAD which causes the offending code to be skipped but does not prevent the user from enabling it.
The divide-by-zero is here in kernel/sched.c:
static void update_cpu_load(struct rq *this_rq)
{
u64 fair_delta64, exec_delta64, idle_delta64, sample_interval64, tmp64;
unsigned long total_load = this_rq->ls.load.weight;
unsigned long this_load = total_load;
struct load_stat *ls = &this_rq->ls;
int i, scale;
this_rq->nr_load_updates++;
if (unlikely(!(sysctl_sched_features & SCHED_FEAT_PRECISE_CPU_LOAD)))
goto do_avg;
/* Update delta_fair/delta_exec fields first */
update_curr_load(this_rq);
fair_delta64 = ls->delta_fair + 1;
ls->delta_fair = 0;
exec_delta64 = ls->delta_exec + 1;
ls->delta_exec = 0;
sample_interval64 = this_rq->clock - ls->load_update_last;
ls->load_update_last = this_rq->clock;
if ((s64)sample_interval64 < (s64)TICK_NSEC)
sample_interval64 = TICK_NSEC;
if (exec_delta64 > sample_interval64)
exec_delta64 = sample_interval64;
idle_delta64 = sample_interval64 - exec_delta64;======> tmp64 = div64_64(SCHED_LOAD_SCALE * exec_delta64, fair_delta64); tmp64 = div64_64(tmp64 * exec_delta64, sample_interval64); this_load = (unsigned long)tmp64;
do_avg:
/* Update our load: */
for (i = 0, scale = 1; i < CPU_LOAD_IDX_MAX; i++, scale += scale) {
unsigned long old_load, new_load;
/* scale is effectively 1 << i now, and >> i divides by scale */
old_load = this_rq->cpu_load[i];
new_load = this_load;
this_rq->cpu_load[i] = (old_load*(scale-1) + new_load) >> i;
}
}For stable only; the code has been removed in 2.6.24.
--- kernel/sched_fair.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
kernel/sched_fair.c +1 -1
@@ -93,7 +93,7 @@ unsigned int sysctl_sched_features __reaSCHED_FEAT_FAIR_SLEEPERS *1 |SCHED_FEAT_SLEEPER_AVG *0 |SCHED_FEAT_SLEEPER_LOAD_AVG *1 | -SCHED_FEAT_PRECISE_CPU_LOAD *1 | +SCHED_FEAT_PRECISE_CPU_LOAD *0 |SCHED_FEAT_START_DEBIT *1 |SCHED_FEAT_SKIP_INITIAL *0 ;
PATCH 16/29 geode: Fix not inplace encryption
In reply to Greg Kroah-Hartman2.6.23-stable review patch. If anyone has any objections, please let us know.
------------------
From: Sebastian Siewior <[email protected]>
patch 2e21630ddc3fb717dc645356b75771c6a52dc627 in mainline.
Currently the Geode AES module fails to encrypt or decrypt if the coherent bits are not set what is currently the case if the encryption does not occur inplace. However, the encryption works on my Geode machine _only_ if the coherent bits are always set.
--- drivers/crypto/geode-aes.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-)
drivers/crypto/geode-aes.c +1 -2
@@ -110,8 +110,7 @@ geode_aes_crypt(struct geode_aes_op *op)* we don't need to worry */ -if (op->src == op->dst) - flags |= (AES_CTRL_DCA |AES_CTRL_SCA ); + flags |= (AES_CTRL_DCA |AES_CTRL_SCA );if (op->dir ==AES_DIR_ENCRYPT ) flags |=AES_CTRL_ENCRYPT ;
PATCH 17/29 libcrc32c: keep intermediate crc state in cpu order
In reply to Greg Kroah-Hartman2.6.23-stable review patch. If anyone has any objections, please let us know.
------------------
From: Herbert Xu <[email protected]>
It's upstream changeset ef19454bd437b2ba14c9cda1de85debd9f383484.
[LIB] crc32c: Keep intermediate crc state in cpu order
crypto/crc32.c:chksum_final() is computing the digest as *(__le32 *)out = ~cpu_to_le32(mctx->crc);
so the low-level crc32c_le routines should just keep the crc in cpu order, otherwise it is getting swabbed one too many times on big-endian machines.
--- lib/libcrc32c.c | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-)
lib/libcrc32c.c +2 -5
@@ -33,7 +33,6 @@#include <linux/crc32c.h> #include <linux/compiler.h> #include <linux/module.h> -#include <asm/byteorder.h> MODULE_AUTHOR ("Clay Haapala <[email protected]>" );MODULE_DESCRIPTION ("CRC32c (Castagnoli) calculations" );
@@ -161,15 +160,13 @@ static const u32 crc32c_table[256] = {*/ u32 __attribute_pure__ -crc32c_le (u32 seed,unsigned char const *data,size_t length) +crc32c_le (u32 crc,unsigned char const *data,size_t length) { -u32 crc =__cpu_to_le32 (seed); -while (length--) crc = crc32c_table[(crc ^ *data++) &0xFFL ] ^ (crc >>8 ); -return __le32_to_cpu (crc); +return crc; }#endif /* CRC_LE_BITS == 8 */
PATCH 18/29 i386: avoid temporarily inconsistent pte-s
In reply to Greg Kroah-Hartman2.6.23-stable review patch. If anyone has any objections, please let us know.
------------------
From: Jan Beulich <[email protected]>
patch aa506dc7b12d03fbf8fd11aab752aed1aadd9c07 in mainline.
i386: avoid temporarily inconsistent pte-s
One more of these issues (which were considered fixed a few releases back): other than on x86-64, i386 allows set_fixmap() to replace already present mappings. Consequently, on PAE, care must be taken to not update the high half of a pte while the low half is still holding the old value.
[ tglx: arch/x86 adaptation ]
--- arch/i386/mm/pgtable.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-)
arch/i386/mm/pgtable.c +1 -2
@@ -97,8 +97,7 @@ static void set_pte_pfn(unsigned long va } pte =pte_offset_kernel (pmd, vaddr);if (pgprot_val (flags)) -/* <pfn,flags> stored as-is, to permit clearing entries */ -set_pte (pte,pfn_pte (pfn, flags)); +set_pte_present (&init_mm, vaddr, pte,pfn_pte (pfn, flags));else pte_clear (&init_mm, vaddr, pte);
PATCH 19/29 x86: fix off-by-one in find_next_zero_string
In reply to Greg Kroah-Hartman2.6.23-stable review patch. If anyone has any objections, please let us know.
------------------
From: Andrew Hastings <[email protected]>
patch 801916c1b369b637ce799e6c71a94963ff63df79 in mainline.
x86: fix off-by-one in find_next_zero_string
Fix an off-by-one error in find_next_zero_string which prevents allocating the last bit.
[ tglx: arch/x86 adaptation ]
--- arch/x86_64/lib/bitstr.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
arch/x86_64/lib/bitstr.c +1 -1
@@ -14,7 +14,7 @@ find_next_zero_string(unsigned long *bit/* could test bitsliced, but it's hardly worth it */ end = n+len; -if (end >= nbits) +if (end > nbits)return -1 ;for (i = n+1 ; i < end; i++) {if (test_bit (i, bitmap)) {
PATCH 20/29 x86: mark read_crX() asm code as volatile
In reply to Greg Kroah-Hartman2.6.23-stable review patch. If anyone has any objections, please let us know.
------------------
From: Kirill Korotaev <[email protected]>
patch c1217a75ea102d4e69321f210fab60bc47b9a48e in mainline.
x86: mark read_crX() asm code as volatile
Some gcc versions (I checked at least 4.1.1 from RHEL5 & 4.1.2 from gentoo) can generate incorrect code with read_crX()/write_crX() functions mix up, due to cached results of read_crX().
The small app for x8664 below compiled with -O2 demonstrates this (i686 does the same thing):
--- include/asm-i386/system.h | 2 +- include/asm-x86_64/system.h | 8 ++++---- 2 files changed, 5 insertions(+), 5 deletions(-)
include/asm-i386/system.h +1 -1
@@ -141,7 +141,7 @@ static inline unsigned long native_read_ {unsigned long val;/* This could fault if %cr4 does not exist */ - asm("1: movl %%cr4, %0 \n" + asmvolatile ("1: movl %%cr4, %0 \n" "2: \n" ".section __ex_table,\"a\" \n" ".long 1b,2b \n"
include/asm-x86_64/system.h +4 -4
@@ -85,7 +85,7 @@ static inline void write_cr0(unsigned lostatic inline unsigned long read_cr2 (void ) {unsigned long cr2; - asm("movq %%cr2,%0" :"=r" (cr2)); + asmvolatile ("movq %%cr2,%0" :"=r" (cr2));return cr2; }
@@ -97,7 +97,7 @@ static inline void write_cr2(unsigned lostatic inline unsigned long read_cr3 (void ) {unsigned long cr3; - asm("movq %%cr3,%0" :"=r" (cr3)); + asmvolatile ("movq %%cr3,%0" :"=r" (cr3));return cr3; }
@@ -109,7 +109,7 @@ static inline void write_cr3(unsigned lostatic inline unsigned long read_cr4 (void ) {unsigned long cr4; - asm("movq %%cr4,%0" :"=r" (cr4)); + asmvolatile ("movq %%cr4,%0" :"=r" (cr4));return cr4; }
@@ -121,7 +121,7 @@ static inline void write_cr4(unsigned lostatic inline unsigned long read_cr8 (void ) {unsigned long cr8; - asm("movq %%cr8,%0" :"=r" (cr8)); + asmvolatile ("movq %%cr8,%0" :"=r" (cr8));return cr8; }
PATCH 21/29 x86: NX bit handling in change_page_attr()
In reply to Greg Kroah-Hartman2.6.23-stable review patch. If anyone has any objections, please let us know.
------------------
From: Huang, Ying <[email protected]>
patch 84e0fdb1754d066dd0a8b257de7299f392d1e727 in mainline.
x86: NX bit handling in change_page_attr()
This patch fixes a bug of change_page_attr/change_page_attr_addr on Intel x86_64 CPUs. After changing page attribute to be executable with these functions, the page remains un-executable on Intel x86_64 CPU. Because on Intel x86_64 CPU, only if the "NX" bits of all four level page tables are cleared, the corresponding page is executable (refer to section 4.13.2 of Intel 64 and IA-32 Architectures Software Developer's Manual). So, the bug is fixed through clearing the "NX" bit of PMD when splitting the huge PMD.
--- arch/x86_64/mm/pageattr.c | 1 + 1 file changed, 1 insertion(+)
arch/x86_64/mm/pageattr.c +1 -0
@@ -148,6 +148,7 @@ __change_page_attr(unsigned long address split =split_large_page (address, prot, ref_prot2);if (!split)return -ENOMEM ; +pgprot_val (ref_prot2) &= ~_PAGE_NX;set_pte (kpte,mk_pte (split, ref_prot2)); kpte_page = split; }
PATCH 22/29 x86: return correct error code from child_rip in x86_64 entry.S
In reply to Greg Kroah-Hartman2.6.23-stable review patch. If anyone has any objections, please let us know.
------------------
From: Andrey Mirkin <[email protected]>
patch 1c5b5cfd290b6cb7c67020ef420e275f746a7236 in mainline.
x86: return correct error code from child_rip in x86_64 entry.S
Right now register edi is just cleared before calling do_exit. That is wrong because correct return value will be ignored. Value from rax should be copied to rdi instead of clearing edi.
AK: changed to 32bit move because it's strictly an int
[ tglx: arch/x86 adaptation ]
--- arch/x86_64/kernel/entry.S | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
arch/x86_64/kernel/entry.S +1 -1
@@ -989,7 +989,7 @@ child_rip: movq %rsi, %rdi call *%rax # exit - xorl %edi, %edi + mov %eax, %edi call do_exit CFI_ENDPROC ENDPROC(child_rip)
PATCH 23/29 ntp: fix typo that makes sync_cmos_clock erratic
In reply to Greg Kroah-Hartman2.6.23-stable review patch. If anyone has any objections, please let us know.
------------------
From: David P. Reed <[email protected]>
patch fa6a1a554b50cbb7763f6907e6fef927ead480d9 in mainline.
ntp: fix typo that makes sync_cmos_clock erratic
Fix a typo in ntp.c that has caused updating of the persistent (RTC) clock when synced to NTP to behave erratically.
When debugging a freeze that arises on my AMD64 machines when I run the ntpd service, I added a number of printk's to monitor the sync_cmos_clock procedure. I discovered that it was not syncing to cmos RTC every 11 minutes as documented, but instead would keep trying every second for hours at a time. The reason turned out to be a typo in sync_cmos_clock, where it attempts to ensure that update_persistent_clock is called very close to 500 msec. after a 1 second boundary (required by the PC RTC's spec). That typo referred to "xtime" in one spot, rather than "now", which is derived from "xtime" but not equal to it. This makes the test erratic, creating a "coin-flip" that decides when update_persistent_clock is called - when it is called, which is rarely, it may be at any time during the one second period, rather than close to 500 msec, so the value written is needlessly incorrect, too.
--- kernel/time/ntp.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
kernel/time/ntp.c +1 -1
@@ -205,7 +205,7 @@ static void sync_cmos_clock(unsigned lonreturn ;getnstimeofday (&now); -if (abs (xtime.tv_nsec - (NSEC_PER_SEC /2 )) <= tick_nsec /2 ) +if (abs (now.tv_nsec - (NSEC_PER_SEC /2 )) <= tick_nsec /2 ) fail =update_persistent_clock (now); next.tv_nsec = (NSEC_PER_SEC /2 ) - now.tv_nsec;
PATCH 24/29 x86: fix freeze in x86_64 RTC update code in time_64.c
In reply to Greg Kroah-Hartman2.6.23-stable review patch. If anyone has any objections, please let us know.
------------------
From: David P. Reed <[email protected]>
patch c399da0d97e06803e51085ec076b63a3168aad1b in mainline.
x86: fix freeze in x86_64 RTC update code in time_64.c
Fix hard freeze on x86_64 when the ntpd service calls update_persistent_clock()
A repeatable but randomly timed freeze has been happening in Fedora 6 and 7 for the last year, whenever I run the ntpd service on my AMD64x2 HP Pavilion dv9000z laptop. This freeze is due to the use of spin_lock(&rtc_lock) under the assumption (per a bad comment) that set_rtc_mmss is called only with interrupts disabled. The call from ntp.c to update_persistent_clock is made with interrupts enabled.
[ [email protected]: ported to 2.6.23.stable ]
--- arch/x86_64/kernel/time.c | 11 ++++------- 1 file changed, 4 insertions(+), 7 deletions(-)
arch/x86_64/kernel/time.c +4 -7
@@ -87,18 +87,15 @@ static int set_rtc_mmss(unsigned long noint retval =0 ;int real_seconds, real_minutes, cmos_minutes;unsigned char control, freq_select; +unsigned long flags;/* -* IRQs are disabled when we're called from the timer interrupt, -* no need for spin_lock_irqsave() +* set_rtc_mmss is called when irqs are enabled, so disable irqs here */ - -spin_lock (&rtc_lock); - +spin_lock_irqsave (&rtc_lock, flags);/* * Tell the clock it's being set and stop it. */ - control =CMOS_READ (RTC_CONTROL );CMOS_WRITE (control |RTC_SET ,RTC_CONTROL );
@@ -143,7 +140,7 @@ static int set_rtc_mmss(unsigned long noCMOS_WRITE (control,RTC_CONTROL );CMOS_WRITE (freq_select,RTC_FREQ_SELECT ); -spin_unlock (&rtc_lock); +spin_unlock_irqrestore (&rtc_lock, flags);return retval; }
PATCH 25/29 softlockup watchdog fixes and cleanups
In reply to Greg Kroah-Hartman2.6.23-stable review patch. If anyone has any objections, please let us know.
------------------
From: Ingo Molnar <[email protected]>
This is a merge of commits a5f2ce3c6024a5bb895647b6bd88ecae5001020a and 43581a10075492445f65234384210492ff333eba in mainline to fix a warning in the 2.6.23.3 kernel release.
softlockup watchdog: style cleanups
kernel/softirq.c grew a few style uncleanlinesses in the past few months, clean that up. No functional changes:
text data bss dec hex filename 1126 76 4 1206 4b6 softlockup.o.before 1129 76 4 1209 4b9 softlockup.o.after
( the 3 bytes .text increase is due to the "<1>" appended to one of the printk messages. )
softlockup: improve debug output
Improve the debuggability of kernel lockups by enhancing the debug output of the softlockup detector: print the task that causes the lockup and try to print a more intelligent backtrace.
The old format was:
BUG: soft lockup detected on CPU#1! [<c0105e4a>] show_trace_log_lvl+0x19/0x2e [<c0105f43>] show_trace+0x12/0x14 [<c0105f59>] dump_stack+0x14/0x16 [<c015f6bc>] softlockup_tick+0xbe/0xd0 [<c013457d>] run_local_timers+0x12/0x14 [<c01346b8>] update_process_times+0x3e/0x63 [<c0145fb8>] tick_sched_timer+0x7c/0xc0 [<c0140a75>] hrtimer_interrupt+0x135/0x1ba [<c011bde7>] smp_apic_timer_interrupt+0x6e/0x80 [<c0105aa3>] apic_timer_interrupt+0x33/0x38 [<c0104f8a>] syscall_call+0x7/0xb =======================
The new format is:
BUG: soft lockup detected on CPU#1! [prctl:2363]
Pid: 2363, comm: prctl
EIP: 0060:[<c013915f>] CPU: 1
EIP is at sys_prctl+0x24/0x18c
EFLAGS: 00000213 Not tainted (2.6.22-cfs-v20 #26)
EAX: 00000001 EBX: 000003e7 ECX: 00000001 EDX: f6df0000
ESI: 000003e7 EDI: 000003e7 EBP: f6df0fb0 DS: 007b ES: 007b FS: 00d8
CR0: 8005003b CR2: 4d8c3340 CR3: 3731d000 CR4: 000006d0
[<c0105e4a>] show_trace_log_lvl+0x19/0x2e [<c0105f43>] show_trace+0x12/0x14 [<c01040be>] show_regs+0x1ab/0x1b3 [<c015f807>] softlockup_tick+0xef/0x108 [<c013457d>] run_local_timers+0x12/0x14 [<c01346b8>] update_process_times+0x3e/0x63 [<c0145fcc>] tick_sched_timer+0x7c/0xc0 [<c0140a89>] hrtimer_interrupt+0x135/0x1ba [<c011bde7>] smp_apic_timer_interrupt+0x6e/0x80 [<c0105aa3>] apic_timer_interrupt+0x33/0x38 [<c0104f8a>] syscall_call+0x7/0xb =======================
Note that in the old format we only knew that some system call locked up, we didnt know _which_. With the new format we know that it's at a specific place in sys_prctl(). [which was where i created an artificial kernel lockup to test the new format.]
This is also useful if the lockup happens in user-space - the user-space EIP (and other registers) will be printed too. (such a lockup would either suggest that the task was running at SCHED_FIFO:99 and looping for more than 10 seconds, or that the softlockup detector has a false-positive.)
The task name is printed too first, just in case we dont manage to print a useful backtrace.
--- kernel/softlockup.c | 37 +++++++++++++++++++++++-------------- 1 file changed, 23 insertions(+), 14 deletions(-)
kernel/softlockup.c +23 -14
@@ -15,13 +15,16 @@#include <linux/notifier.h> #include <linux/module.h> +#include <asm/irq_regs.h> +static DEFINE_SPINLOCK (print_lock); static DEFINE_PER_CPU(unsigned long, touch_timestamp); static DEFINE_PER_CPU(unsigned long, print_timestamp); static DEFINE_PER_CPU(struct task_struct *, watchdog_task); -static int did_panic =0 ; +static int did_panic; +int softlockup_thresh =10 ;static int softlock_panic (struct notifier_block *this,unsigned long event,void *ptr)
@@ -70,6 +73,7 @@ void softlockup_tick(void)int this_cpu =smp_processor_id ();unsigned long touch_timestamp =per_cpu (touch_timestamp, this_cpu);unsigned long print_timestamp; +struct pt_regs *regs =get_irq_regs ();unsigned long now;if (touch_timestamp ==0 ) {
@@ -99,21 +103,26 @@ void softlockup_tick(void)wake_up_process (per_cpu (watchdog_task, this_cpu));/* Warn about unreasonable 10+ seconds delays: */ -if (now > (touch_timestamp +10 )) { -per_cpu (print_timestamp, this_cpu) = touch_timestamp; +if (now <= (touch_timestamp + softlockup_thresh)) +return ; + +per_cpu (print_timestamp, this_cpu) = touch_timestamp; -spin_lock (&print_lock); -printk (KERN_ERR "BUG: soft lockup detected on CPU#%d!\n" , - this_cpu); +spin_lock (&print_lock); +printk (KERN_ERR "BUG: soft lockup - CPU#%d stuck for %lus! [%s:%d]\n" , + this_cpu, now - touch_timestamp, + current->comm, current->pid); +if (regs) +show_regs (regs); +else dump_stack (); -spin_unlock (&print_lock); - } +spin_unlock (&print_lock); }/* * The watchdog thread - runs every second and touches the timestamp. */ -static int watchdog (void * __bind_cpu) +static int watchdog (void *__bind_cpu) {struct sched_param param = { .sched_priority =MAX_RT_PRIO -1 };
@@ -151,13 +160,13 @@ cpu_callback(struct notifier_block *nfb,BUG_ON (per_cpu (watchdog_task, hotcpu)); p =kthread_create (watchdog, hcpu,"watchdog/%d" , hotcpu);if (IS_ERR (p)) { -printk ("watchdog for %i failed\n" , hotcpu); +printk (KERN_ERR "watchdog for %i failed\n" , hotcpu);return NOTIFY_BAD ; } -per_cpu (touch_timestamp, hotcpu) =0 ; -per_cpu (watchdog_task, hotcpu) = p; +per_cpu (touch_timestamp, hotcpu) =0 ; +per_cpu (watchdog_task, hotcpu) = p;kthread_bind (p, hotcpu); -break ; +break ;case CPU_ONLINE :case CPU_ONLINE_FROZEN :wake_up_process (per_cpu (watchdog_task, hotcpu));
@@ -177,7 +186,7 @@ cpu_callback(struct notifier_block *nfb,kthread_stop (p);break ;#endif /* CONFIG_HOTPLUG_CPU */ - } + }return NOTIFY_OK ; }
PATCH 26/29 softlockup: use cpu_clock() instead of sched_clock()
In reply to Greg Kroah-Hartman2.6.23-stable review patch. If anyone has any objections, please let us know.
------------------
From: Ingo Molnar <[email protected]>
patch a3b13c23f186ecb57204580cc1f2dbe9c284953a in mainline.
sched_clock() is not a reliable time-source, use cpu_clock() instead.
--- kernel/softlockup.c | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-)
kernel/softlockup.c +6 -4
@@ -43,14 +43,16 @@ static struct notifier_block panic_block* resolution, and we don't need to waste time with a big divide when * 2^30ns == 1.074s. */ -static unsigned long get_timestamp (void ) +static unsigned long get_timestamp (int this_cpu) { -return sched_clock () >>30 ;/* 2^30 ~= 10^9 */ +return cpu_clock (this_cpu) >>30 ;/* 2^30 ~= 10^9 */ }void touch_softlockup_watchdog (void ) { -__raw_get_cpu_var (touch_timestamp) =get_timestamp (); +int this_cpu =raw_smp_processor_id (); + +__raw_get_cpu_var (touch_timestamp) =get_timestamp (this_cpu); }EXPORT_SYMBOL (touch_softlockup_watchdog);
@@ -96,7 +98,7 @@ void softlockup_tick(void)return ; } - now =get_timestamp (); + now =get_timestamp (this_cpu);/* Wake up the high-prio watchdog task every second: */ if (now > (touch_timestamp +1 ))
PATCH 27/29 USB: unusual_devs modification for Nikon D200
In reply to Greg Kroah-Hartman2.6.23-stable review patch. If anyone has any objections, please let us know.
------------------
From: Phil Dibowitz <[email protected]>
patch 16eb345f4d9189b59bae576ae63cba7ca77817b2 in mainline.
Upgrade the unusual_devs.h file to support the Nikon D200
--- drivers/usb/storage/unusual_devs.h | 7 +++++++ 1 file changed, 7 insertions(+)
drivers/usb/storage/unusual_devs.h +7 -0
@@ -341,6 +341,13 @@ UNUSUAL_DEV( 0x04b0, 0x040d, 0x0100, 0x US_SC_DEVICE, US_PR_DEVICE, NULL, US_FL_FIX_CAPACITY), +/* Reported by Graber and Mike Pagano <[email protected]> */ +UNUSUAL_DEV (0x04b0 ,0x040f ,0x0200 ,0x0200 , +"NIKON" , +"NIKON DSC D200" , +US_SC_DEVICE ,US_PR_DEVICE ,NULL , +US_FL_FIX_CAPACITY ), +/* Reported by Emil Larsson <[email protected]> */ UNUSUAL_DEV( 0x04b0, 0x0411, 0x0100, 0x0101, "NIKON",
PATCH 28/29 USB: Nikon D40X unusual_devs entry
In reply to Greg Kroah-Hartman2.6.23-stable review patch. If anyone has any objections, please let us know.
------------------
From: Ortwin Glück <[email protected]>
patch d466a9190ff1ceddfee50686e61d63590fc820d9 in mainline.
Not surprisingly the Nikon D40X DSC needs the same quirks as the D40, but it has a separate ID.
See http://bugs.gentoo.org/show_bug.cgi?id=191431
From: Ortwin Glück <[email protected]>
--- drivers/usb/storage/unusual_devs.h | 7 +++++++ 1 file changed, 7 insertions(+)
drivers/usb/storage/unusual_devs.h +7 -0
@@ -362,6 +362,13 @@ UNUSUAL_DEV( 0x04b0, 0x0413, 0x0110, 0x US_SC_DEVICE, US_PR_DEVICE, NULL, US_FL_FIX_CAPACITY), +/* Reported by Shan Destromp ([email protected]) */ +UNUSUAL_DEV (0x04b0 ,0x0417 ,0x0100 ,0x0100 , +"NIKON" , +"NIKON DSC D40X" , +US_SC_DEVICE ,US_PR_DEVICE ,NULL , + US_FL_FIX_CAPACITY), +/* BENQ DC5330 * Reported by Manuel Fombuena <[email protected]> and * Frank Copeland <[email protected]> */
PATCH 29/29 ipw2200: batch non-user-requested scan result notifications
In reply to Greg Kroah-Hartman2.6.23-stable review patch. If anyone has any objections, please let us know.
------------------
From: Dan Williams <[email protected]>
patch 0b5316769774d1dc2fdd702e095f9e6992af269a in mainline.
ipw2200 makes extensive use of background scanning when unassociated or down. Unfortunately, the firmware sends scan completed events many times per second, which the driver pushes directly up to userspace. This needlessly wakes up processes listening for wireless events many times per second. Batch together scan completed events for non-user-requested scans and send them up to userspace every 4 seconds. Scan completed events resulting from an SIOCSIWSCAN call are pushed up without delay.
--- drivers/net/wireless/ipw2200.c | 56 +++++++++++++++++++++++++++++++++-------- drivers/net/wireless/ipw2200.h | 3 ++ 2 files changed, 49 insertions(+), 10 deletions(-)
drivers/net/wireless/ipw2200.c +46 -10
@@ -1740,8 +1740,10 @@ static int ipw_radio_kill_sw(struct ipw_if (disable_radio) { priv->status |=STATUS_RF_KILL_SW ; -if (priv->workqueue) +if (priv->workqueue) {cancel_delayed_work (&priv->request_scan); +cancel_delayed_work (&priv->scan_event); + }queue_work (priv->workqueue, &priv->down); }else { priv->status &= ~STATUS_RF_KILL_SW ;
@@ -1992,6 +1994,7 @@ static void ipw_irq_tasklet(struct ipw_pwake_up_interruptible (&priv->wait_command_queue); priv->status &= ~(STATUS_ASSOCIATED |STATUS_ASSOCIATING );cancel_delayed_work (&priv->request_scan); +cancel_delayed_work (&priv->scan_event);schedule_work (&priv->link_down);queue_delayed_work (priv->workqueue, &priv->rf_kill,2 *HZ ); handled |=IPW_INTA_BIT_RF_KILL_DONE ;
@@ -4341,6 +4344,37 @@ static void ipw_handle_missed_beacon(strIPW_DEBUG_NOTIF ("Missed beacon: %d\n" , missed_count); } +static void ipw_scan_event (struct work_struct *work) +{ +union iwreq_data wrqu; + +struct ipw_priv *priv = + container_of(work, struct ipw_priv, scan_event.work); + + wrqu.data.length =0 ; + wrqu.data.flags =0 ; +wireless_send_event (priv->net_dev,SIOCGIWSCAN , &wrqu,NULL ); +} + +static void handle_scan_event (struct ipw_priv *priv) +{ +/* Only userspace-requested scan completion events go out immediately */ +if (!priv->user_requested_scan) { +if (!delayed_work_pending (&priv->scan_event)) +queue_delayed_work (priv->workqueue, &priv->scan_event, +round_jiffies (msecs_to_jiffies (4000 ))); + }else { +union iwreq_data wrqu; + + priv->user_requested_scan =0 ; +cancel_delayed_work (&priv->scan_event); + + wrqu.data.length =0 ; + wrqu.data.flags =0 ; +wireless_send_event (priv->net_dev,SIOCGIWSCAN , &wrqu,NULL ); + } +} +/** * Handle host notification packet. * Called from interrupt routine
@@ -4702,14 +4736,8 @@ static void ipw_rx_notification(struct i* on how the scan was initiated. User space can just * sync on periodic scan to get fresh data... * Jean II */ -if (x->status ==SCAN_COMPLETED_STATUS_COMPLETE ) { -union iwreq_data wrqu; - - wrqu.data.length =0 ; - wrqu.data.flags =0 ; -wireless_send_event (priv->net_dev,SIOCGIWSCAN , - &wrqu,NULL ); - } +if (x->status ==SCAN_COMPLETED_STATUS_COMPLETE ) +handle_scan_event (priv);break ; }
@@ -9472,6 +9500,10 @@ static int ipw_wx_set_scan(struct net_destruct ipw_priv *priv =ieee80211_priv (dev);struct iw_scan_req *req = (struct iw_scan_req *)extra; +mutex_lock (&priv->mutex); + priv->user_requested_scan =1 ; +mutex_unlock (&priv->mutex); +if (wrqu->data.length ==sizeof (struct iw_scan_req )) {if (wrqu->data.flags &IW_SCAN_THIS_ESSID ) { ipw_request_direct_scan(priv, req->essid,
@@ -10647,6 +10679,7 @@ static void ipw_link_up(struct ipw_priv }cancel_delayed_work (&priv->request_scan); +cancel_delayed_work (&priv->scan_event);ipw_reset_stats (priv);/* Ensure the rate is updated immediately */ priv->last_rate =ipw_get_current_rate (priv);
@@ -10684,7 +10717,8 @@ static void ipw_link_down(struct ipw_priif (!(priv->status &STATUS_EXIT_PENDING )) {/* Queue up another scan... */ queue_delayed_work (priv->workqueue, &priv->request_scan,0 ); - } + }else +cancel_delayed_work (&priv->scan_event); }static void ipw_bg_link_down (struct work_struct *work)
@@ -10714,6 +10748,7 @@ static int ipw_setup_deferred_work(strucINIT_WORK (&priv->up, ipw_bg_up);INIT_WORK (&priv->down, ipw_bg_down);INIT_DELAYED_WORK (&priv->request_scan, ipw_request_scan); +INIT_DELAYED_WORK (&priv->scan_event, ipw_scan_event);INIT_WORK (&priv->request_passive_scan, ipw_request_passive_scan);INIT_DELAYED_WORK (&priv->gather_stats, ipw_bg_gather_stats);INIT_WORK (&priv->abort_scan, ipw_bg_abort_scan);
@@ -11746,6 +11781,7 @@ static void ipw_pci_remove(struct pci_decancel_delayed_work (&priv->adhoc_check);cancel_delayed_work (&priv->gather_stats);cancel_delayed_work (&priv->request_scan); +cancel_delayed_work (&priv->scan_event);cancel_delayed_work (&priv->rf_kill);cancel_delayed_work (&priv->scan_check);destroy_workqueue (priv->workqueue);
drivers/net/wireless/ipw2200.h +3 -0
@@ -1288,6 +1288,8 @@ struct ipw_priv {struct iw_public_data wireless_data; +int user_requested_scan; +struct workqueue_struct *workqueue;struct delayed_work adhoc_check;
@@ -1296,6 +1298,7 @@ struct ipw_priv {struct work_struct system_config;struct work_struct rx_replenish;struct delayed_work request_scan; +struct delayed_work scan_event;struct work_struct request_passive_scan;struct work_struct adapter_restart;struct delayed_work rf_kill;
Quoted 9 lines · Greg Kroah-Hartman
This is the start of the stable review cycle for the 2.6.23.9 release. There are 29 patches in this series, all will be posted as a response to this one. If anyone has any issues with these being applied, please let us know. If anyone is a maintainer of the proper subsystem, and wants to add a Signed-off-by: line to the patch, please respond with it.
I would especially like people who experienced the softlockup messages in their kernel logs on 2.6.23.8 to test this series to make sure that everything is now working properly.
And the full patch can be found at:
kernel.org/pub/linux/kernel/v2.6/stable-review/patch-2.6.23.9-rc1.gz
The diffstat is below.
thanks,
greg k-h
------------------
Makefile | 2 - arch/i386/lib/delay.c | 3 + arch/i386/mm/pgtable.c | 3 - arch/x86_64/kernel/entry.S | 2 - arch/x86_64/kernel/time.c | 11 ++----- arch/x86_64/lib/bitstr.c | 2 - arch/x86_64/lib/delay.c | 11 ++++--- arch/x86_64/mm/pageattr.c | 1 drivers/acpi/video.c | 13 +++++++- drivers/ata/sata_sis.c | 15 +++++---- drivers/crypto/geode-aes.c | 3 - drivers/dma/dmaengine.c | 17 +++-------- drivers/i2c/busses/i2c-pasemi.c | 5 +++ drivers/i2c/chips/eeprom.c | 37 +++++++++++++++--------- drivers/md/raid5.c | 16 +++++----- drivers/net/wireless/ipw2200.c | 56 ++++++++++++++++++++++++++++++------- drivers/net/wireless/ipw2200.h | 3 + drivers/oprofile/cpu_buffer.c | 7 ++++ drivers/oprofile/cpu_buffer.h | 1 drivers/oprofile/oprofile_stats.c | 4 ++ drivers/usb/storage/unusual_devs.h | 14 +++++++++ drivers/video/ps3fb.c | 2 - fs/nfsd/nfs2acl.c | 2 - fs/nfsd/nfs3acl.c | 2 - fs/nfsd/nfsfh.c | 43 +++++++++++++++++----------- fs/reiserfs/stree.c | 3 - include/asm-i386/system.h | 2 - include/asm-x86_64/system.h | 8 ++--- kernel/sched_fair.c | 2 - kernel/softlockup.c | 47 +++++++++++++++++++------------ kernel/time/ntp.c | 2 - lib/libcrc32c.c | 7 +--- 32 files changed, 227 insertions(+), 119 deletions(-)
A message that is not in the archive (sent off-list or not yet received): [email protected]
PATCH 12/29 sata_sis: fix SCR read breakage
2.6.23-stable review patch. If anyone has any objections, please let us know.
------------------
From: Tejun Heo <[email protected]>
patch aaa092a114696f4425cd57c4d7fa05110007e247 in mainline.
sata_sis: fix SCR read breakage
SCR read for controllers which uses PCI configuration space for SCR access got broken while adding @val argument to SCR accessors. Fix it.
--- drivers/ata/sata_sis.c | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-)
drivers/ata/sata_sis.c +8 -5
@@ -168,11 +168,11 @@ static unsigned int get_scr_cfg_addr(strreturn addr; } -static u32 sis_scr_cfg_read (struct ata_port *ap,unsigned int sc_reg) +static u32 sis_scr_cfg_read (struct ata_port *ap,unsigned int sc_reg,u32 *val) {struct pci_dev *pdev =to_pci_dev (ap->host->dev);unsigned int cfg_addr =get_scr_cfg_addr (ap, sc_reg); -u32 val, val2 =0 ; +u32 val2 =0 ;u8 pmr;if (sc_reg ==SCR_ERROR )/* doesn't exist in PCI cfg space */
@@ -180,13 +180,16 @@ static u32 sis_scr_cfg_read (struct ata_pci_read_config_byte (pdev,SIS_PMR , &pmr); -pci_read_config_dword (pdev, cfg_addr, &val); +pci_read_config_dword (pdev, cfg_addr, val);if ((pdev->device ==0x0182 ) || (pdev->device ==0x0183 ) || (pdev->device ==0x1182 ) || (pmr &SIS_PMR_COMBINED ))pci_read_config_dword (pdev, cfg_addr+0x10 , &val2); -return (val|val2) &0xfffffffb ;/* avoid problems with powerdowned ports */ + *val |= val2; + *val &=0xfffffffb ;/* avoid problems with powerdowned ports */ + +return 0 ; }static void sis_scr_cfg_write (struct ata_port *ap,unsigned int sc_reg,u32 val)
@@ -216,7 +219,7 @@ static int sis_scr_read(struct ata_portreturn -EINVAL ;if (ap->flags &SIS_FLAG_CFGSCR ) -return sis_scr_cfg_read (ap, sc_reg); +return sis_scr_cfg_read (ap, sc_reg, val);pci_read_config_byte (pdev,SIS_PMR , &pmr);