* [PATCH] i2c-cpm: Pass dev ptr to dma_*_coherent rather than NULL
@ 2009-04-21 12:49 Mark Ware
[not found] ` <49EDC0BE.7040505-kb99s61Wg94xnpGSZB1jBA@public.gmane.org>
0 siblings, 1 reply; 9+ messages in thread
From: Mark Ware @ 2009-04-21 12:49 UTC (permalink / raw)
To: linuxppc-dev-mnsaURCQ41sdnm+yROfE0A,
linux-i2c-u79uwXL29TY76Z2rM5mHXA
Recent DMA changes result in a BUG() when NULL is passed to
dma_alloc_coherent in place of a device.
Signed-off-by: Mark Ware <mware-kb99s61Wg94xnpGSZB1jBA@public.gmane.org>
---
This patch fixes the BUG() during boot that has appeared during the
2.6.30 window. It has been tested and appears correct on my 8280 based
board.
Sent to both linuxppc-dev and linux-i2c, since I'm not sure where it belongs.
drivers/i2c/busses/i2c-cpm.c | 14 ++++++++------
1 files changed, 8 insertions(+), 6 deletions(-)
diff --git a/drivers/i2c/busses/i2c-cpm.c b/drivers/i2c/busses/i2c-cpm.c
index 3fcf78e..83276d2 100644
--- a/drivers/i2c/busses/i2c-cpm.c
+++ b/drivers/i2c/busses/i2c-cpm.c
@@ -532,7 +532,8 @@ static int __devinit cpm_i2c_setup(struct cpm_i2c *cpm)
for (i = 0; i < CPM_MAXBD; i++) {
cpm->rxbuf[i] = dma_alloc_coherent(
- NULL, CPM_MAX_READ + 1, &cpm->rxdma[i], GFP_KERNEL);
+ &cpm->ofdev->dev, CPM_MAX_READ + 1, &cpm->rxdma[i],
+ GFP_KERNEL);
if (!cpm->rxbuf[i]) {
ret = -ENOMEM;
goto out_muram;
@@ -540,7 +541,8 @@ static int __devinit cpm_i2c_setup(struct cpm_i2c *cpm)
out_be32(&rbdf[i].cbd_bufaddr, ((cpm->rxdma[i] + 1) & ~1));
cpm->txbuf[i] = (unsigned char *)dma_alloc_coherent(
- NULL, CPM_MAX_READ + 1, &cpm->txdma[i], GFP_KERNEL);
+ &cpm->ofdev->dev, CPM_MAX_READ + 1, &cpm->txdma[i],
+ GFP_KERNEL);
if (!cpm->txbuf[i]) {
ret = -ENOMEM;
goto out_muram;
@@ -585,10 +587,10 @@ static int __devinit cpm_i2c_setup(struct cpm_i2c *cpm)
out_muram:
for (i = 0; i < CPM_MAXBD; i++) {
if (cpm->rxbuf[i])
- dma_free_coherent(NULL, CPM_MAX_READ + 1,
+ dma_free_coherent(&cpm->ofdev->dev, CPM_MAX_READ + 1,
cpm->rxbuf[i], cpm->rxdma[i]);
if (cpm->txbuf[i])
- dma_free_coherent(NULL, CPM_MAX_READ + 1,
+ dma_free_coherent(&cpm->ofdev->dev, CPM_MAX_READ + 1,
cpm->txbuf[i], cpm->txdma[i]);
}
cpm_muram_free(cpm->dp_addr);
@@ -619,9 +621,9 @@ static void cpm_i2c_shutdown(struct cpm_i2c *cpm)
/* Free all memory */
for (i = 0; i < CPM_MAXBD; i++) {
- dma_free_coherent(NULL, CPM_MAX_READ + 1,
+ dma_free_coherent(&cpm->ofdev->dev, CPM_MAX_READ + 1,
cpm->rxbuf[i], cpm->rxdma[i]);
- dma_free_coherent(NULL, CPM_MAX_READ + 1,
+ dma_free_coherent(&cpm->ofdev->dev, CPM_MAX_READ + 1,
cpm->txbuf[i], cpm->txdma[i]);
}
--
1.5.6.5
^ permalink raw reply related [flat|nested] 9+ messages in thread[parent not found: <49EDC0BE.7040505-kb99s61Wg94xnpGSZB1jBA@public.gmane.org>]
* Re: [PATCH] i2c-cpm: Pass dev ptr to dma_*_coherent rather than NULL [not found] ` <49EDC0BE.7040505-kb99s61Wg94xnpGSZB1jBA@public.gmane.org> @ 2009-04-21 13:32 ` Jochen Friedrich 2009-04-21 15:11 ` Kumar Gala 1 sibling, 0 replies; 9+ messages in thread From: Jochen Friedrich @ 2009-04-21 13:32 UTC (permalink / raw) To: Mark Ware Cc: linuxppc-dev-mnsaURCQ41sdnm+yROfE0A, linux-i2c-u79uwXL29TY76Z2rM5mHXA Mark Ware schrieb: > Recent DMA changes result in a BUG() when NULL is passed to > dma_alloc_coherent in place of a device. This seems to have happened in 4ae0ff606e848fa4957ebf8f97e5db5fdeec27be. > Signed-off-by: Mark Ware <mware-kb99s61Wg94xnpGSZB1jBA@public.gmane.org> Acked-by: Jochen Friedrich <jochen-NIgtFMG+Po8@public.gmane.org> Thanks, Jochen ^ permalink raw reply [flat|nested] 9+ messages in thread
* Re: [PATCH] i2c-cpm: Pass dev ptr to dma_*_coherent rather than NULL [not found] ` <49EDC0BE.7040505-kb99s61Wg94xnpGSZB1jBA@public.gmane.org> 2009-04-21 13:32 ` Jochen Friedrich @ 2009-04-21 15:11 ` Kumar Gala [not found] ` <E2205842-8019-4CE4-812B-64ABD76F36F4-XVmvHMARGAS8U2dJNN8I7kB+6BGkLq7r@public.gmane.org> 1 sibling, 1 reply; 9+ messages in thread From: Kumar Gala @ 2009-04-21 15:11 UTC (permalink / raw) To: Ben Dooks Cc: Linuxppc-dev Development, linux-i2c-u79uwXL29TY76Z2rM5mHXA, Mark Ware On Apr 21, 2009, at 7:49 AM, Mark Ware wrote: > Recent DMA changes result in a BUG() when NULL is passed to > dma_alloc_coherent in place of a device. > > Signed-off-by: Mark Ware <mware-kb99s61Wg94xnpGSZB1jBA@public.gmane.org> > --- > > This patch fixes the BUG() during boot that has appeared during the > 2.6.30 window. It has been tested and appears correct on my 8280 based > board. > Sent to both linuxppc-dev and linux-i2c, since I'm not sure where it > belongs. > > > drivers/i2c/busses/i2c-cpm.c | 14 ++++++++------ > 1 files changed, 8 insertions(+), 6 deletions(-) Acked-by: Kumar Gala <galak-XVmvHMARGAS8U2dJNN8I7kB+6BGkLq7r@public.gmane.org> Ben, I'm expecting you to pick this up unless you tell me otherwise. - k ^ permalink raw reply [flat|nested] 9+ messages in thread
[parent not found: <E2205842-8019-4CE4-812B-64ABD76F36F4-XVmvHMARGAS8U2dJNN8I7kB+6BGkLq7r@public.gmane.org>]
* Re: [PATCH] i2c-cpm: Pass dev ptr to dma_*_coherent rather than NULL [not found] ` <E2205842-8019-4CE4-812B-64ABD76F36F4-XVmvHMARGAS8U2dJNN8I7kB+6BGkLq7r@public.gmane.org> @ 2009-04-22 21:56 ` Ben Dooks 2009-04-29 13:43 ` Kumar Gala 0 siblings, 1 reply; 9+ messages in thread From: Ben Dooks @ 2009-04-22 21:56 UTC (permalink / raw) To: Kumar Gala Cc: Ben Dooks, Linuxppc-dev Development, linux-i2c-u79uwXL29TY76Z2rM5mHXA, Mark Ware On Tue, Apr 21, 2009 at 10:11:51AM -0500, Kumar Gala wrote: > > On Apr 21, 2009, at 7:49 AM, Mark Ware wrote: > > >Recent DMA changes result in a BUG() when NULL is passed to > >dma_alloc_coherent in place of a device. > > > >Signed-off-by: Mark Ware <mware-kb99s61Wg94xnpGSZB1jBA@public.gmane.org> > >--- > > > >This patch fixes the BUG() during boot that has appeared during the > >2.6.30 window. It has been tested and appears correct on my 8280 based > >board. > >Sent to both linuxppc-dev and linux-i2c, since I'm not sure where it > >belongs. > > > > > >drivers/i2c/busses/i2c-cpm.c | 14 ++++++++------ > >1 files changed, 8 insertions(+), 6 deletions(-) > > Acked-by: Kumar Gala <galak-XVmvHMARGAS8U2dJNN8I7kB+6BGkLq7r@public.gmane.org> > > Ben, I'm expecting you to pick this up unless you tell me otherwise. Yes. -- Ben Q: What's a light-year? A: One-third less calories than a regular year. ^ permalink raw reply [flat|nested] 9+ messages in thread
* Re: [PATCH] i2c-cpm: Pass dev ptr to dma_*_coherent rather than NULL 2009-04-22 21:56 ` Ben Dooks @ 2009-04-29 13:43 ` Kumar Gala [not found] ` <AAD6564F-9D99-492B-8364-10A652F990DF-XVmvHMARGAS8U2dJNN8I7kB+6BGkLq7r@public.gmane.org> 0 siblings, 1 reply; 9+ messages in thread From: Kumar Gala @ 2009-04-29 13:43 UTC (permalink / raw) To: Ben Dooks; +Cc: Linuxppc-dev Development, linux-i2c, Mark Ware On Apr 22, 2009, at 4:56 PM, Ben Dooks wrote: > On Tue, Apr 21, 2009 at 10:11:51AM -0500, Kumar Gala wrote: >> >> On Apr 21, 2009, at 7:49 AM, Mark Ware wrote: >> >>> Recent DMA changes result in a BUG() when NULL is passed to >>> dma_alloc_coherent in place of a device. >>> >>> Signed-off-by: Mark Ware <mware@elphinstone.net> >>> --- >>> >>> This patch fixes the BUG() during boot that has appeared during the >>> 2.6.30 window. It has been tested and appears correct on my 8280 >>> based >>> board. >>> Sent to both linuxppc-dev and linux-i2c, since I'm not sure where it >>> belongs. >>> >>> >>> drivers/i2c/busses/i2c-cpm.c | 14 ++++++++------ >>> 1 files changed, 8 insertions(+), 6 deletions(-) >> >> Acked-by: Kumar Gala <galak@kernel.crashing.org> >> >> Ben, I'm expecting you to pick this up unless you tell me otherwise. > > Yes. This go in yet? - k ^ permalink raw reply [flat|nested] 9+ messages in thread
[parent not found: <AAD6564F-9D99-492B-8364-10A652F990DF-XVmvHMARGAS8U2dJNN8I7kB+6BGkLq7r@public.gmane.org>]
* Re: [PATCH] i2c-cpm: Pass dev ptr to dma_*_coherent rather than NULL [not found] ` <AAD6564F-9D99-492B-8364-10A652F990DF-XVmvHMARGAS8U2dJNN8I7kB+6BGkLq7r@public.gmane.org> @ 2009-05-03 22:23 ` Ben Dooks [not found] ` <20090503222352.GB5750-elnMNo+KYs3pIgCt6eIbzw@public.gmane.org> 0 siblings, 1 reply; 9+ messages in thread From: Ben Dooks @ 2009-05-03 22:23 UTC (permalink / raw) To: Kumar Gala Cc: Ben Dooks, Linuxppc-dev Development, linux-i2c-u79uwXL29TY76Z2rM5mHXA, Mark Ware On Wed, Apr 29, 2009 at 08:43:14AM -0500, Kumar Gala wrote: > > On Apr 22, 2009, at 4:56 PM, Ben Dooks wrote: > >> On Tue, Apr 21, 2009 at 10:11:51AM -0500, Kumar Gala wrote: >>> >>> On Apr 21, 2009, at 7:49 AM, Mark Ware wrote: >>> >>>> Recent DMA changes result in a BUG() when NULL is passed to >>>> dma_alloc_coherent in place of a device. >>>> >>>> Signed-off-by: Mark Ware <mware-kb99s61Wg94xnpGSZB1jBA@public.gmane.org> >>>> --- >>>> >>>> This patch fixes the BUG() during boot that has appeared during the >>>> 2.6.30 window. It has been tested and appears correct on my 8280 >>>> based >>>> board. >>>> Sent to both linuxppc-dev and linux-i2c, since I'm not sure where it >>>> belongs. >>>> >>>> >>>> drivers/i2c/busses/i2c-cpm.c | 14 ++++++++------ >>>> 1 files changed, 8 insertions(+), 6 deletions(-) >>> >>> Acked-by: Kumar Gala <galak-XVmvHMARGAS8U2dJNN8I7kB+6BGkLq7r@public.gmane.org> >>> >>> Ben, I'm expecting you to pick this up unless you tell me otherwise. >> >> Yes. > > This go in yet? I've had to do a manual apply due to some changes in the driver, so can someone please do a build of my git tree at: git://aeryn.fluff.org.uk/bjdooks/linux.git i2c-for-2630-rc5 or tell me which arch and defconfig to build. -- Ben (ben-elnMNo+KYs3YtjvyW6yDsg@public.gmane.org, http://www.fluff.org/) 'a smiley only costs 4 bytes' ^ permalink raw reply [flat|nested] 9+ messages in thread
[parent not found: <20090503222352.GB5750-elnMNo+KYs3pIgCt6eIbzw@public.gmane.org>]
* Re: [PATCH] i2c-cpm: Pass dev ptr to dma_*_coherent rather than NULL [not found] ` <20090503222352.GB5750-elnMNo+KYs3pIgCt6eIbzw@public.gmane.org> @ 2009-05-03 23:58 ` Mark Ware 2009-05-11 4:28 ` Mark Ware 1 sibling, 0 replies; 9+ messages in thread From: Mark Ware @ 2009-05-03 23:58 UTC (permalink / raw) To: Ben Dooks; +Cc: Linuxppc-dev Development, linux-i2c-u79uwXL29TY76Z2rM5mHXA Ben Dooks wrote: > On Wed, Apr 29, 2009 at 08:43:14AM -0500, Kumar Gala wrote: >> On Apr 22, 2009, at 4:56 PM, Ben Dooks wrote: >> >>> On Tue, Apr 21, 2009 at 10:11:51AM -0500, Kumar Gala wrote: >>>> On Apr 21, 2009, at 7:49 AM, Mark Ware wrote: >>>> >>>>> Recent DMA changes result in a BUG() when NULL is passed to >>>>> dma_alloc_coherent in place of a device. >>>>> >>>>> Signed-off-by: Mark Ware <mware-kb99s61Wg94xnpGSZB1jBA@public.gmane.org> >>>>> --- >>>>> >>>>> This patch fixes the BUG() during boot that has appeared during the >>>>> 2.6.30 window. It has been tested and appears correct on my 8280 >>>>> based >>>>> board. >>>>> Sent to both linuxppc-dev and linux-i2c, since I'm not sure where it >>>>> belongs. >>>>> >>>>> >>>>> drivers/i2c/busses/i2c-cpm.c | 14 ++++++++------ >>>>> 1 files changed, 8 insertions(+), 6 deletions(-) >>>> Acked-by: Kumar Gala <galak-XVmvHMARGAS8U2dJNN8I7kB+6BGkLq7r@public.gmane.org> >>>> >>>> Ben, I'm expecting you to pick this up unless you tell me otherwise. >>> Yes. >> This go in yet? > > I've had to do a manual apply due to some changes in the > driver, so can someone please do a build of my git tree > at: > > git://aeryn.fluff.org.uk/bjdooks/linux.git i2c-for-2630-rc5 > > or tell me which arch and defconfig to build. > Fails to build, due to a typo. Once fixed (diff below), it builds and tests OK on my MPC8280 based hardware Thanks. Mark diff --git a/drivers/i2c/busses/i2c-cpm.c b/drivers/i2c/busses/i2c-cpm.c index b4c0448..b5db8b8 100644 --- a/drivers/i2c/busses/i2c-cpm.c +++ b/drivers/i2c/busses/i2c-cpm.c @@ -585,7 +585,7 @@ static int __devinit cpm_i2c_setup(struct cpm_i2c *cpm) out_muram: for (i = 0; i < CPM_MAXBD; i++) { if (cpm->rxbuf[i]) - dma_free_coherent(&cpm->ofdev->devL, CPM_MAX_READ + 1, + dma_free_coherent(&cpm->ofdev->dev, CPM_MAX_READ + 1, cpm->rxbuf[i], cpm->rxdma[i]); if (cpm->txbuf[i]) dma_free_coherent(&cpm->ofdev->dev, CPM_MAX_READ + 1, ^ permalink raw reply related [flat|nested] 9+ messages in thread
* Re: [PATCH] i2c-cpm: Pass dev ptr to dma_*_coherent rather than NULL [not found] ` <20090503222352.GB5750-elnMNo+KYs3pIgCt6eIbzw@public.gmane.org> 2009-05-03 23:58 ` Mark Ware @ 2009-05-11 4:28 ` Mark Ware [not found] ` <4A07A982.40504-kb99s61Wg94xnpGSZB1jBA@public.gmane.org> 1 sibling, 1 reply; 9+ messages in thread From: Mark Ware @ 2009-05-11 4:28 UTC (permalink / raw) To: Ben Dooks Cc: Kumar Gala, Linuxppc-dev Development, linux-i2c-u79uwXL29TY76Z2rM5mHXA Ben Dooks wrote: > On Wed, Apr 29, 2009 at 08:43:14AM -0500, Kumar Gala wrote: >> On Apr 22, 2009, at 4:56 PM, Ben Dooks wrote: >> >>> On Tue, Apr 21, 2009 at 10:11:51AM -0500, Kumar Gala wrote: >>>> On Apr 21, 2009, at 7:49 AM, Mark Ware wrote: >>>> >>>>> Recent DMA changes result in a BUG() when NULL is passed to >>>>> dma_alloc_coherent in place of a device. >>>>> >>>>> Signed-off-by: Mark Ware <mware-kb99s61Wg94xnpGSZB1jBA@public.gmane.org> >>>>> --- >>>>> >>>>> This patch fixes the BUG() during boot that has appeared during the >>>>> 2.6.30 window. It has been tested and appears correct on my 8280 >>>>> based >>>>> board. >>>>> Sent to both linuxppc-dev and linux-i2c, since I'm not sure where it >>>>> belongs. >>>>> >>>>> >>>>> drivers/i2c/busses/i2c-cpm.c | 14 ++++++++------ >>>>> 1 files changed, 8 insertions(+), 6 deletions(-) >>>> Acked-by: Kumar Gala <galak-XVmvHMARGAS8U2dJNN8I7kB+6BGkLq7r@public.gmane.org> >>>> >>>> Ben, I'm expecting you to pick this up unless you tell me otherwise. >>> Yes. >> This go in yet? > > I've had to do a manual apply due to some changes in the > driver, so can someone please do a build of my git tree > at: > > git://aeryn.fluff.org.uk/bjdooks/linux.git i2c-for-2630-rc5 > > or tell me which arch and defconfig to build. > Ping. Is there anything still blocking this? Mark Ware ^ permalink raw reply [flat|nested] 9+ messages in thread
[parent not found: <4A07A982.40504-kb99s61Wg94xnpGSZB1jBA@public.gmane.org>]
* Re: [PATCH] i2c-cpm: Pass dev ptr to dma_*_coherent rather than NULL [not found] ` <4A07A982.40504-kb99s61Wg94xnpGSZB1jBA@public.gmane.org> @ 2009-05-11 23:18 ` Ben Dooks 0 siblings, 0 replies; 9+ messages in thread From: Ben Dooks @ 2009-05-11 23:18 UTC (permalink / raw) To: Mark Ware Cc: Ben Dooks, Kumar Gala, Linuxppc-dev Development, linux-i2c-u79uwXL29TY76Z2rM5mHXA On Mon, May 11, 2009 at 02:28:50PM +1000, Mark Ware wrote: > Ben Dooks wrote: >> On Wed, Apr 29, 2009 at 08:43:14AM -0500, Kumar Gala wrote: >>> On Apr 22, 2009, at 4:56 PM, Ben Dooks wrote: >>> >>>> On Tue, Apr 21, 2009 at 10:11:51AM -0500, Kumar Gala wrote: >>>>> On Apr 21, 2009, at 7:49 AM, Mark Ware wrote: >>>>> >>>>>> Recent DMA changes result in a BUG() when NULL is passed to >>>>>> dma_alloc_coherent in place of a device. >>>>>> >>>>>> Signed-off-by: Mark Ware <mware-kb99s61Wg94xnpGSZB1jBA@public.gmane.org> >>>>>> --- >>>>>> >>>>>> This patch fixes the BUG() during boot that has appeared during the >>>>>> 2.6.30 window. It has been tested and appears correct on my >>>>>> 8280 based >>>>>> board. >>>>>> Sent to both linuxppc-dev and linux-i2c, since I'm not sure where it >>>>>> belongs. >>>>>> >>>>>> >>>>>> drivers/i2c/busses/i2c-cpm.c | 14 ++++++++------ >>>>>> 1 files changed, 8 insertions(+), 6 deletions(-) >>>>> Acked-by: Kumar Gala <galak-XVmvHMARGAS8U2dJNN8I7kB+6BGkLq7r@public.gmane.org> >>>>> >>>>> Ben, I'm expecting you to pick this up unless you tell me otherwise. >>>> Yes. >>> This go in yet? >> >> I've had to do a manual apply due to some changes in the >> driver, so can someone please do a build of my git tree >> at: >> >> git://aeryn.fluff.org.uk/bjdooks/linux.git i2c-for-2630-rc5 >> >> or tell me which arch and defconfig to build. >> > > Ping. Is there anything still blocking this? sorry, have been ill recently, will get this sorted and pushed. -- Ben (ben-elnMNo+KYs3YtjvyW6yDsg@public.gmane.org, http://www.fluff.org/) 'a smiley only costs 4 bytes' ^ permalink raw reply [flat|nested] 9+ messages in thread
end of thread, other threads:[~2009-05-11 23:18 UTC | newest]
Thread overview: 9+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2009-04-21 12:49 [PATCH] i2c-cpm: Pass dev ptr to dma_*_coherent rather than NULL Mark Ware
[not found] ` <49EDC0BE.7040505-kb99s61Wg94xnpGSZB1jBA@public.gmane.org>
2009-04-21 13:32 ` Jochen Friedrich
2009-04-21 15:11 ` Kumar Gala
[not found] ` <E2205842-8019-4CE4-812B-64ABD76F36F4-XVmvHMARGAS8U2dJNN8I7kB+6BGkLq7r@public.gmane.org>
2009-04-22 21:56 ` Ben Dooks
2009-04-29 13:43 ` Kumar Gala
[not found] ` <AAD6564F-9D99-492B-8364-10A652F990DF-XVmvHMARGAS8U2dJNN8I7kB+6BGkLq7r@public.gmane.org>
2009-05-03 22:23 ` Ben Dooks
[not found] ` <20090503222352.GB5750-elnMNo+KYs3pIgCt6eIbzw@public.gmane.org>
2009-05-03 23:58 ` Mark Ware
2009-05-11 4:28 ` Mark Ware
[not found] ` <4A07A982.40504-kb99s61Wg94xnpGSZB1jBA@public.gmane.org>
2009-05-11 23:18 ` Ben Dooks
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).