linux-next.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Stephen Rothwell <sfr@canb.auug.org.au>
To: Al Viro <viro@ZenIV.linux.org.uk>
Cc: linux-next@vger.kernel.org, linux-kernel@vger.kernel.org,
	David Howells <dhowells@redhat.com>,
	Vasant Hegde <hegdevasant@linux.vnet.ibm.com>,
	Benjamin Herrenschmidt <benh@kernel.crashing.org>,
	linuxppc-dev@lists.ozlabs.org
Subject: linux-next: manual merge of the vfs tree with the powerpc tree
Date: Wed, 1 May 2013 12:06:36 +1000	[thread overview]
Message-ID: <20130501120636.0e54681b2dfb7ebe6aeb27c4@canb.auug.org.au> (raw)

[-- Attachment #1: Type: text/plain, Size: 4740 bytes --]

Hi Al,

Today's linux-next merge of the vfs tree got a conflict in
arch/powerpc/kernel/rtas_flash.c between commit fb4696c39573
("powerpc/rtas_flash: Fix bad memory access") from the powerpc tree and
commits ad18a364f186 ("powerpc/rtas_flash: Free kmem upon module exit")
and 2352ad01409d ("ppc: Clean up rtas_flash driver somewhat") from the
vfs tree.

I fixed it up (see below) and can carry the fix as necessary (no action
is required).

-- 
Cheers,
Stephen Rothwell                    sfr@canb.auug.org.au

diff --cc arch/powerpc/kernel/rtas_flash.c
index 243e184,5b77026..0000000
--- a/arch/powerpc/kernel/rtas_flash.c
+++ b/arch/powerpc/kernel/rtas_flash.c
@@@ -310,9 -316,9 +328,9 @@@ static ssize_t rtas_flash_write(struct 
  	 * proc file
  	 */
  	if (uf->flist == NULL) {
 -		uf->flist = kmem_cache_alloc(flash_block_cache, GFP_KERNEL);
 +		uf->flist = kmem_cache_zalloc(flash_block_cache, GFP_KERNEL);
  		if (!uf->flist)
- 			return -ENOMEM;
+ 			goto nomem;
  	}
  
  	fl = uf->flist;
@@@ -321,18 -327,18 +339,18 @@@
  	next_free = fl->num_blocks;
  	if (next_free == FLASH_BLOCKS_PER_NODE) {
  		/* Need to allocate another block_list */
 -		fl->next = kmem_cache_alloc(flash_block_cache, GFP_KERNEL);
 +		fl->next = kmem_cache_zalloc(flash_block_cache, GFP_KERNEL);
  		if (!fl->next)
- 			return -ENOMEM;
+ 			goto nomem;
  		fl = fl->next;
  		next_free = 0;
  	}
  
  	if (count > RTAS_BLK_SIZE)
  		count = RTAS_BLK_SIZE;
 -	p = kmem_cache_alloc(flash_block_cache, GFP_KERNEL);
 +	p = kmem_cache_zalloc(flash_block_cache, GFP_KERNEL);
  	if (!p)
- 		return -ENOMEM;
+ 		goto nomem;
  	
  	if(copy_from_user(p, buffer, count)) {
  		kmem_cache_free(flash_block_cache, p);
@@@ -722,65 -694,13 +706,13 @@@ static int __init rtas_flash_init(void
  		return 1;
  	}
  
- 	firmware_flash_pde = create_flash_pde("powerpc/rtas/"
- 					      FIRMWARE_FLASH_NAME,
- 					      &rtas_flash_operations);
- 	if (firmware_flash_pde == NULL) {
- 		rc = -ENOMEM;
- 		goto cleanup;
- 	}
- 
- 	rc = initialize_flash_pde_data("ibm,update-flash-64-and-reboot",
- 			 	       sizeof(struct rtas_update_flash_t), 
- 				       firmware_flash_pde);
- 	if (rc != 0)
- 		goto cleanup;
- 
- 	firmware_update_pde = create_flash_pde("powerpc/rtas/"
- 					       FIRMWARE_UPDATE_NAME,
- 					       &rtas_flash_operations);
- 	if (firmware_update_pde == NULL) {
- 		rc = -ENOMEM;
- 		goto cleanup;
- 	}
- 
- 	rc = initialize_flash_pde_data("ibm,update-flash-64-and-reboot",
- 			 	       sizeof(struct rtas_update_flash_t), 
- 				       firmware_update_pde);
- 	if (rc != 0)
- 		goto cleanup;
- 
- 	validate_pde = create_flash_pde("powerpc/rtas/" VALIDATE_FLASH_NAME,
- 			      		&validate_flash_operations);
- 	if (validate_pde == NULL) {
- 		rc = -ENOMEM;
- 		goto cleanup;
- 	}
- 
- 	rc = initialize_flash_pde_data("ibm,validate-flash-image",
- 		                       sizeof(struct rtas_validate_flash_t), 
- 				       validate_pde);
- 	if (rc != 0)
- 		goto cleanup;
- 
- 	manage_pde = create_flash_pde("powerpc/rtas/" MANAGE_FLASH_NAME,
- 				      &manage_flash_operations);
- 	if (manage_pde == NULL) {
- 		rc = -ENOMEM;
- 		goto cleanup;
- 	}
- 
- 	rc = initialize_flash_pde_data("ibm,manage-flash-image",
- 			               sizeof(struct rtas_manage_flash_t),
- 				       manage_pde);
- 	if (rc != 0)
- 		goto cleanup;
- 
- 	rtas_flash_term_hook = rtas_flash_firmware;
+ 	rtas_validate_flash_data.buf = kzalloc(VALIDATE_BUF_SIZE, GFP_KERNEL);
+ 	if (!rtas_validate_flash_data.buf)
+ 		return -ENOMEM;
  
  	flash_block_cache = kmem_cache_create("rtas_flash_cache",
 -					      RTAS_BLK_SIZE, RTAS_BLK_SIZE, 0,
 -					      rtas_block_ctor);
 +				RTAS_BLK_SIZE, RTAS_BLK_SIZE, 0,
 +				NULL);
  	if (!flash_block_cache) {
  		printk(KERN_ERR "%s: failed to create block cache\n",
  				__func__);
@@@ -800,20 -742,17 +754,22 @@@ enomem_buf
  
  static void __exit rtas_flash_cleanup(void)
  {
+ 	int i;
+ 
  	rtas_flash_term_hook = NULL;
  
 +	if (rtas_firmware_flash_list) {
 +		free_flash_list(rtas_firmware_flash_list);
 +		rtas_firmware_flash_list = NULL;
 +	}
 +
- 	if (flash_block_cache)
- 		kmem_cache_destroy(flash_block_cache);
+ 	for (i = 0; i < ARRAY_SIZE(rtas_flash_files); i++) {
+ 		const struct rtas_flash_file *f = &rtas_flash_files[i];
+ 		remove_proc_entry(f->filename, NULL);
+ 	}
  
- 	remove_flash_pde(firmware_flash_pde);
- 	remove_flash_pde(firmware_update_pde);
- 	remove_flash_pde(validate_pde);
- 	remove_flash_pde(manage_pde);
+ 	kmem_cache_destroy(flash_block_cache);
+ 	kfree(rtas_validate_flash_data.buf);
  }
  
  module_init(rtas_flash_init);

[-- Attachment #2: Type: application/pgp-signature, Size: 836 bytes --]

             reply	other threads:[~2013-05-01  2:06 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-05-01  2:06 Stephen Rothwell [this message]
2013-05-01  5:01 ` linux-next: manual merge of the vfs tree with the powerpc tree Vasant Hegde
2013-05-01  5:10   ` Al Viro
  -- strict thread matches above, loose matches on Subject: below --
2020-07-27  1:32 Stephen Rothwell
2013-04-29  1:35 Stephen Rothwell
2013-04-29  3:40 ` Benjamin Herrenschmidt

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20130501120636.0e54681b2dfb7ebe6aeb27c4@canb.auug.org.au \
    --to=sfr@canb.auug.org.au \
    --cc=benh@kernel.crashing.org \
    --cc=dhowells@redhat.com \
    --cc=hegdevasant@linux.vnet.ibm.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-next@vger.kernel.org \
    --cc=linuxppc-dev@lists.ozlabs.org \
    --cc=viro@ZenIV.linux.org.uk \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).