mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Stefan Richter <stefanr@s5r6.in-berlin.de>
To: linux1394-devel@lists.sourceforge.net
Cc: linux-kernel@vger.kernel.org, "Kristian Høgsberg" <krh@redhat.com>
Subject: [PATCH] firewire: fw-ohci: avoid an atomic allocation
Date: Tue, 16 Oct 2007 20:30:58 +0200 (CEST)	[thread overview]
Message-ID: <tkrat.ee2011f98a2490f3@s5r6.in-berlin.de> (raw)
In-Reply-To: <tkrat.ee2f970ab4b4ccbd@s5r6.in-berlin.de>

All of the buffers which are allocated during fw-ohci's pci_probe can be
allocated with GFP_KERNEL.

Signed-off-by: Stefan Richter <stefanr@s5r6.in-berlin.de>
---
 drivers/firewire/fw-ohci.c |   10 +++++-----
 1 file changed, 5 insertions(+), 5 deletions(-)

Index: linux-2.6.23-rc6/drivers/firewire/fw-ohci.c
===================================================================
--- linux-2.6.23-rc6.orig/drivers/firewire/fw-ohci.c
+++ linux-2.6.23-rc6/drivers/firewire/fw-ohci.c
@@ -242,14 +242,14 @@ ohci_update_phy_reg(struct fw_card *card
 	return 0;
 }
 
-static int ar_context_add_page(struct ar_context *ctx)
+static int ar_context_add_page(struct ar_context *ctx, gfp_t gfp_mask)
 {
 	struct device *dev = ctx->ohci->card.device;
 	struct ar_buffer *ab;
 	dma_addr_t ab_bus;
 	size_t offset;
 
-	ab = (struct ar_buffer *) __get_free_page(GFP_ATOMIC);
+	ab = (struct ar_buffer *) __get_free_page(gfp_mask);
 	if (ab == NULL)
 		return -ENOMEM;
 
@@ -397,7 +397,7 @@ static void ar_context_tasklet(unsigned 
 			buffer = handle_ar_packet(ctx, buffer);
 
 		free_page((unsigned long)buffer);
-		ar_context_add_page(ctx);
+		ar_context_add_page(ctx, GFP_ATOMIC);
 	} else {
 		buffer = ctx->pointer;
 		ctx->pointer = end =
@@ -418,8 +418,8 @@ ar_context_init(struct ar_context *ctx, 
 	ctx->last_buffer = &ab;
 	tasklet_init(&ctx->tasklet, ar_context_tasklet, (unsigned long)ctx);
 
-	ar_context_add_page(ctx);
-	ar_context_add_page(ctx);
+	ar_context_add_page(ctx, GFP_KERNEL);
+	ar_context_add_page(ctx, GFP_KERNEL);
 	ctx->current_buffer = ab.next;
 	ctx->pointer = ctx->current_buffer->data;
 

-- 
Stefan Richter
-=====-=-=== =-=- =----
http://arcgraph.de/sr/


  reply	other threads:[~2007-10-16 18:31 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2007-10-16 17:25 [PATCH] firewire: fw-ohci: fix DMA mapping for ar context Stefan Richter
2007-10-16 17:35 ` Stefan Richter
2007-10-16 17:40   ` [PATCH corrected] " Stefan Richter
2007-10-16 17:58     ` [PATCH] firewire: fw-ohci: optimize initialization of " Stefan Richter
2007-10-16 18:30       ` Stefan Richter [this message]
2007-10-16 19:49     ` [PATCH corrected] firewire: fw-ohci: fix DMA mapping for " Stefan Richter

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=tkrat.ee2011f98a2490f3@s5r6.in-berlin.de \
    --to=stefanr@s5r6.in-berlin.de \
    --cc=krh@redhat.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux1394-devel@lists.sourceforge.net \
    /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

all inboxes | Powered by JetHome®