* [PATCH 0/8] Fix virtual and physical address types @ 2011-12-21 1:29 Ben Hutchings 2011-12-21 1:32 ` [PATCH 2/8] farsync: Fix confusion about DMA address and buffer offset types Ben Hutchings 0 siblings, 1 reply; 8+ messages in thread From: Ben Hutchings @ 2011-12-21 1:29 UTC (permalink / raw) To: LKML Cc: Steve Wise, linux-rdma-u79uwXL29TY76Z2rM5mHXA, Kevin Curtis, netdev-u79uwXL29TY76Z2rM5mHXA, David Airlie, dri-devel-PD4FTy7X32lNgt0PjOBp9y5qC8QIuHrW, James E.J. Bottomley, linux-scsi, Hans J. Koch, Greg Kroah-Hartman, Venkat Venkatsubra, rds-devel-N0ozoZBvEnrZJqsBc5GL+g, Anil Ravindranath [-- Attachment #1: Type: text/plain, Size: 1164 bytes --] This series fixes compiler warnings on some architectures about implicit conversions and narrowing conversions between pointer and integer types. Please apply these to the appropriate trees. Ben. Ben Hutchings (8): IB/cxgb4: Fix formatting of physical address farsync: Fix confusion about DMA address and buffer offset types drm: Do not include page offset in argument to virt_to_page() drm: Pass pointers to virt_to_page() [SCSI] tgt: Pass pointers to virt_to_page(), not integers uio: Pass pointers to virt_to_page(), not integers rds: Pass pointers to virt_to_page(), not integers pmcraid: Pass pointers to access_ok(), not integers drivers/gpu/drm/drm_pci.c | 4 ++-- drivers/gpu/drm/drm_vm.c | 2 +- drivers/infiniband/hw/cxgb4/device.c | 4 ++-- drivers/net/wan/farsync.c | 19 +++++++------------ drivers/scsi/pmcraid.c | 3 ++- drivers/scsi/scsi_tgt_if.c | 2 +- drivers/uio/uio.c | 6 ++++-- net/rds/message.c | 2 +- 8 files changed, 20 insertions(+), 22 deletions(-) -- 1.7.7.3 [-- Attachment #2: This is a digitally signed message part --] [-- Type: application/pgp-signature, Size: 828 bytes --] ^ permalink raw reply [flat|nested] 8+ messages in thread
* [PATCH 2/8] farsync: Fix confusion about DMA address and buffer offset types 2011-12-21 1:29 [PATCH 0/8] Fix virtual and physical address types Ben Hutchings @ 2011-12-21 1:32 ` Ben Hutchings 2011-12-21 1:42 ` Ben Hutchings 2011-12-21 4:46 ` David Miller 0 siblings, 2 replies; 8+ messages in thread From: Ben Hutchings @ 2011-12-21 1:32 UTC (permalink / raw) To: Kevin Curtis, netdev; +Cc: LKML [-- Attachment #1: Type: text/plain, Size: 2679 bytes --] Consistently use dma_addr_t for DMA addresses, except in fst_{rx,tx}_dma where we truncate them to 32 bits. (We know this is OK because that's the default DMA mask for PCI devices.) Consistently use u32 for buffer offsets within shared memory. Compile-tested only. Signed-off-by: Ben Hutchings <ben@decadent.org.uk> --- drivers/net/wan/farsync.c | 19 +++++++------------ 1 files changed, 7 insertions(+), 12 deletions(-) diff --git a/drivers/net/wan/farsync.c b/drivers/net/wan/farsync.c index ebb9f24..98c04c6 100644 --- a/drivers/net/wan/farsync.c +++ b/drivers/net/wan/farsync.c @@ -886,15 +886,13 @@ fst_rx_dma_complete(struct fst_card_info *card, struct fst_port_info *port, * Receive a frame through the DMA */ static inline void -fst_rx_dma(struct fst_card_info *card, dma_addr_t skb, - dma_addr_t mem, int len) +fst_rx_dma(struct fst_card_info *card, dma_addr_t skb, u32 mem, int len) { /* * This routine will setup the DMA and start it */ - dbg(DBG_RX, "In fst_rx_dma %lx %lx %d\n", - (unsigned long) skb, (unsigned long) mem, len); + dbg(DBG_RX, "In fst_rx_dma %x %x %d\n", (u32)skb, mem, len); if (card->dmarx_in_progress) { dbg(DBG_ASS, "In fst_rx_dma while dma in progress\n"); } @@ -915,20 +913,19 @@ fst_rx_dma(struct fst_card_info *card, dma_addr_t skb, * Send a frame through the DMA */ static inline void -fst_tx_dma(struct fst_card_info *card, unsigned char *skb, - unsigned char *mem, int len) +fst_tx_dma(struct fst_card_info *card, dma_addr_t skb, u32 mem, int len) { /* * This routine will setup the DMA and start it. */ - dbg(DBG_TX, "In fst_tx_dma %p %p %d\n", skb, mem, len); + dbg(DBG_TX, "In fst_tx_dma %x %x %d\n", (u32)skb, mem, len); if (card->dmatx_in_progress) { dbg(DBG_ASS, "In fst_tx_dma while dma in progress\n"); } - outl((unsigned long) skb, card->pci_conf + DMAPADR1); /* Copy from here */ - outl((unsigned long) mem, card->pci_conf + DMALADR1); /* to here */ + outl(skb, card->pci_conf + DMAPADR1); /* Copy from here */ + outl(mem, card->pci_conf + DMALADR1); /* to here */ outl(len, card->pci_conf + DMASIZ1); /* for this length */ outl(0x000000004, card->pci_conf + DMADPR1); /* In this direction */ @@ -1405,9 +1402,7 @@ do_bottom_half_tx(struct fst_card_info *card) card->dma_len_tx = skb->len; card->dma_txpos = port->txpos; fst_tx_dma(card, - (char *) card-> - tx_dma_handle_card, - (char *) + card->tx_dma_handle_card, BUF_OFFSET(txBuffer[pi] [port->txpos][0]), skb->len); -- 1.7.7.3 [-- Attachment #2: This is a digitally signed message part --] [-- Type: application/pgp-signature, Size: 828 bytes --] ^ permalink raw reply related [flat|nested] 8+ messages in thread
* Re: [PATCH 2/8] farsync: Fix confusion about DMA address and buffer offset types 2011-12-21 1:32 ` [PATCH 2/8] farsync: Fix confusion about DMA address and buffer offset types Ben Hutchings @ 2011-12-21 1:42 ` Ben Hutchings 2011-12-21 4:48 ` David Miller 2011-12-21 4:46 ` David Miller 1 sibling, 1 reply; 8+ messages in thread From: Ben Hutchings @ 2011-12-21 1:42 UTC (permalink / raw) To: David Miller; +Cc: netdev [-- Attachment #1: Type: text/plain, Size: 415 bytes --] I accidentally left signing enabled for this one, which I had intended to disable since you've said that patchwork doesn't deal with signatures. Except this looks OK on patchwork: <http://patchwork.ozlabs.org/patch/132548/>. If that also looks OK to you, is there any reason to avoid signing networking patches? Ben. -- Ben Hutchings Humans are not rational beings; they are rationalising beings. [-- Attachment #2: This is a digitally signed message part --] [-- Type: application/pgp-signature, Size: 828 bytes --] ^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: [PATCH 2/8] farsync: Fix confusion about DMA address and buffer offset types 2011-12-21 1:42 ` Ben Hutchings @ 2011-12-21 4:48 ` David Miller 2011-12-21 5:41 ` Ben Hutchings 0 siblings, 1 reply; 8+ messages in thread From: David Miller @ 2011-12-21 4:48 UTC (permalink / raw) To: ben; +Cc: netdev From: Ben Hutchings <ben@decadent.org.uk> Date: Wed, 21 Dec 2011 01:42:26 +0000 > I accidentally left signing enabled for this one, which I had intended > to disable since you've said that patchwork doesn't deal with > signatures. Except this looks OK on patchwork: > <http://patchwork.ozlabs.org/patch/132548/>. > > If that also looks OK to you, is there any reason to avoid signing > networking patches? What do you mean exactly by "signing". Do you mean simply the "Signed-off-by: " tag, which you should always add to your own patches, or something else? ^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: [PATCH 2/8] farsync: Fix confusion about DMA address and buffer offset types 2011-12-21 4:48 ` David Miller @ 2011-12-21 5:41 ` Ben Hutchings 0 siblings, 0 replies; 8+ messages in thread From: Ben Hutchings @ 2011-12-21 5:41 UTC (permalink / raw) To: David Miller; +Cc: netdev [-- Attachment #1: Type: text/plain, Size: 775 bytes --] On Tue, 2011-12-20 at 23:48 -0500, David Miller wrote: > From: Ben Hutchings <ben@decadent.org.uk> > Date: Wed, 21 Dec 2011 01:42:26 +0000 > > > I accidentally left signing enabled for this one, which I had intended > > to disable since you've said that patchwork doesn't deal with > > signatures. Except this looks OK on patchwork: > > <http://patchwork.ozlabs.org/patch/132548/>. > > > > If that also looks OK to you, is there any reason to avoid signing > > networking patches? > > What do you mean exactly by "signing". > > Do you mean simply the "Signed-off-by: " tag, which you should always > add to your own patches, or something else? GPG signing. Ben. -- Ben Hutchings Humans are not rational beings; they are rationalising beings. [-- Attachment #2: This is a digitally signed message part --] [-- Type: application/pgp-signature, Size: 828 bytes --] ^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: [PATCH 2/8] farsync: Fix confusion about DMA address and buffer offset types 2011-12-21 1:32 ` [PATCH 2/8] farsync: Fix confusion about DMA address and buffer offset types Ben Hutchings 2011-12-21 1:42 ` Ben Hutchings @ 2011-12-21 4:46 ` David Miller 2011-12-21 5:41 ` Ben Hutchings 1 sibling, 1 reply; 8+ messages in thread From: David Miller @ 2011-12-21 4:46 UTC (permalink / raw) To: ben; +Cc: kevin.curtis, netdev, linux-kernel From: Ben Hutchings <ben@decadent.org.uk> Date: Wed, 21 Dec 2011 01:32:52 +0000 > - dbg(DBG_RX, "In fst_rx_dma %lx %lx %d\n", > - (unsigned long) skb, (unsigned long) mem, len); > + dbg(DBG_RX, "In fst_rx_dma %x %x %d\n", (u32)skb, mem, len); This is more appropriately fixed by using "%p" instead of casting to a 32-bit int. ^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: [PATCH 2/8] farsync: Fix confusion about DMA address and buffer offset types 2011-12-21 4:46 ` David Miller @ 2011-12-21 5:41 ` Ben Hutchings 2011-12-21 8:33 ` Kevin Curtis 0 siblings, 1 reply; 8+ messages in thread From: Ben Hutchings @ 2011-12-21 5:41 UTC (permalink / raw) To: David Miller; +Cc: kevin.curtis, netdev, linux-kernel [-- Attachment #1: Type: text/plain, Size: 678 bytes --] On Tue, 2011-12-20 at 23:46 -0500, David Miller wrote: > From: Ben Hutchings <ben@decadent.org.uk> > Date: Wed, 21 Dec 2011 01:32:52 +0000 > > > - dbg(DBG_RX, "In fst_rx_dma %lx %lx %d\n", > > - (unsigned long) skb, (unsigned long) mem, len); > > + dbg(DBG_RX, "In fst_rx_dma %x %x %d\n", (u32)skb, mem, len); > > This is more appropriately fixed by using "%p" instead of casting > to a 32-bit int. 'skb' is the physical address of the data in the skb. Whereas 'mem' is the offset of the corresponding buffer in shared memory. All completely clear, right? ;-) Ben. -- Ben Hutchings Humans are not rational beings; they are rationalising beings. [-- Attachment #2: This is a digitally signed message part --] [-- Type: application/pgp-signature, Size: 828 bytes --] ^ permalink raw reply [flat|nested] 8+ messages in thread
* RE: [PATCH 2/8] farsync: Fix confusion about DMA address and buffer offset types 2011-12-21 5:41 ` Ben Hutchings @ 2011-12-21 8:33 ` Kevin Curtis 0 siblings, 0 replies; 8+ messages in thread From: Kevin Curtis @ 2011-12-21 8:33 UTC (permalink / raw) To: Ben Hutchings, David Miller; +Cc: netdev, linux-kernel Hi, Thanks for the patches. I will apply them to the master copy of the source code here. Regards Kevin Curtis Linux Development FarSite Communications Ltd http://www.farsite.com Winner of The Queen's Award for Enterprise 2009 tel: +44 1256 330461 fax: +44 1256 854931 -----Original Message----- From: Ben Hutchings [mailto:ben@decadent.org.uk] Sent: 21 December 2011 05:41 To: David Miller Cc: Kevin Curtis; netdev@vger.kernel.org; linux-kernel@vger.kernel.org Subject: Re: [PATCH 2/8] farsync: Fix confusion about DMA address and buffer offset types On Tue, 2011-12-20 at 23:46 -0500, David Miller wrote: > From: Ben Hutchings <ben@decadent.org.uk> > Date: Wed, 21 Dec 2011 01:32:52 +0000 > > > - dbg(DBG_RX, "In fst_rx_dma %lx %lx %d\n", > > - (unsigned long) skb, (unsigned long) mem, len); > > + dbg(DBG_RX, "In fst_rx_dma %x %x %d\n", (u32)skb, mem, len); > > This is more appropriately fixed by using "%p" instead of casting to a > 32-bit int. 'skb' is the physical address of the data in the skb. Whereas 'mem' is the offset of the corresponding buffer in shared memory. All completely clear, right? ;-) Ben. -- Ben Hutchings Humans are not rational beings; they are rationalising beings. ^ permalink raw reply [flat|nested] 8+ messages in thread
end of thread, other threads:[~2011-12-21 8:48 UTC | newest] Thread overview: 8+ messages (download: mbox.gz follow: Atom feed -- links below jump to the message on this page -- 2011-12-21 1:29 [PATCH 0/8] Fix virtual and physical address types Ben Hutchings 2011-12-21 1:32 ` [PATCH 2/8] farsync: Fix confusion about DMA address and buffer offset types Ben Hutchings 2011-12-21 1:42 ` Ben Hutchings 2011-12-21 4:48 ` David Miller 2011-12-21 5:41 ` Ben Hutchings 2011-12-21 4:46 ` David Miller 2011-12-21 5:41 ` Ben Hutchings 2011-12-21 8:33 ` Kevin Curtis
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).