* [PATCH] video: fbdev: fsl: fix kernel crash when diu_ops is not implemented
@ 2015-11-24 6:27 Dongsheng Wang
2015-11-24 10:46 ` Tomi Valkeinen
` (21 more replies)
0 siblings, 22 replies; 23+ messages in thread
From: Dongsheng Wang @ 2015-11-24 6:27 UTC (permalink / raw)
To: linux-fbdev
From: Wang Dongsheng <dongsheng.wang@freescale.com>
If diu_ops is not implemented on platform, kernel will access a null
pointer. we need to check this pointer in diu initialization.
Signed-off-by: Wang Dongsheng <dongsheng.wang@freescale.com>
diff --git a/drivers/video/fbdev/fsl-diu-fb.c b/drivers/video/fbdev/fsl-diu-fb.c
index b335c1a..288b5e4 100644
--- a/drivers/video/fbdev/fsl-diu-fb.c
+++ b/drivers/video/fbdev/fsl-diu-fb.c
@@ -479,7 +479,10 @@ static enum fsl_diu_monitor_port fsl_diu_name_to_port(const char *s)
port = FSL_DIU_PORT_DLVDS;
}
- return diu_ops.valid_monitor_port(port);
+ if (diu_ops.valid_monitor_port)
+ port = diu_ops.valid_monitor_port(port);
+
+ return port;
}
/*
@@ -1697,6 +1700,9 @@ static int fsl_diu_probe(struct platform_device *pdev)
unsigned int i;
int ret;
+ if (!diu_ops.set_pixel_clock)
+ return -ENODEV;
+
data = dmam_alloc_coherent(&pdev->dev, sizeof(struct fsl_diu_data),
&dma_addr, GFP_DMA | __GFP_ZERO);
if (!data)
--
2.1.0.27.g96db324
^ permalink raw reply related [flat|nested] 23+ messages in thread
* Re: [PATCH] video: fbdev: fsl: fix kernel crash when diu_ops is not implemented
2015-11-24 6:27 [PATCH] video: fbdev: fsl: fix kernel crash when diu_ops is not implemented Dongsheng Wang
@ 2015-11-24 10:46 ` Tomi Valkeinen
2015-11-24 11:01 ` Wang Dongsheng
` (20 subsequent siblings)
21 siblings, 0 replies; 23+ messages in thread
From: Tomi Valkeinen @ 2015-11-24 10:46 UTC (permalink / raw)
To: linux-fbdev
[-- Attachment #1: Type: text/plain, Size: 1183 bytes --]
On 24/11/15 08:27, Dongsheng Wang wrote:
> From: Wang Dongsheng <dongsheng.wang@freescale.com>
>
> If diu_ops is not implemented on platform, kernel will access a null
> pointer. we need to check this pointer in diu initialization.
>
> Signed-off-by: Wang Dongsheng <dongsheng.wang@freescale.com>
>
> diff --git a/drivers/video/fbdev/fsl-diu-fb.c b/drivers/video/fbdev/fsl-diu-fb.c
> index b335c1a..288b5e4 100644
> --- a/drivers/video/fbdev/fsl-diu-fb.c
> +++ b/drivers/video/fbdev/fsl-diu-fb.c
> @@ -479,7 +479,10 @@ static enum fsl_diu_monitor_port fsl_diu_name_to_port(const char *s)
> port = FSL_DIU_PORT_DLVDS;
> }
>
> - return diu_ops.valid_monitor_port(port);
> + if (diu_ops.valid_monitor_port)
> + port = diu_ops.valid_monitor_port(port);
> +
> + return port;
> }
>
> /*
> @@ -1697,6 +1700,9 @@ static int fsl_diu_probe(struct platform_device *pdev)
> unsigned int i;
> int ret;
>
> + if (!diu_ops.set_pixel_clock)
> + return -ENODEV;
> +
> data = dmam_alloc_coherent(&pdev->dev, sizeof(struct fsl_diu_data),
> &dma_addr, GFP_DMA | __GFP_ZERO);
> if (!data)
>
Thanks, queued for 4.5.
Tomi
[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 819 bytes --]
^ permalink raw reply [flat|nested] 23+ messages in thread
* RE: [PATCH] video: fbdev: fsl: fix kernel crash when diu_ops is not implemented
2015-11-24 6:27 [PATCH] video: fbdev: fsl: fix kernel crash when diu_ops is not implemented Dongsheng Wang
2015-11-24 10:46 ` Tomi Valkeinen
@ 2015-11-24 11:01 ` Wang Dongsheng
2015-11-24 16:04 ` Timur Tabi
` (19 subsequent siblings)
21 siblings, 0 replies; 23+ messages in thread
From: Wang Dongsheng @ 2015-11-24 11:01 UTC (permalink / raw)
To: linux-fbdev
VGhhbmtzIFRvbWkuDQoNClJlZ2FyZHMsDQotRG9uZ3NoZW5nDQoNCj4gDQo+IE9uIDI0LzExLzE1
IDA4OjI3LCBEb25nc2hlbmcgV2Fu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9y
dChwb3J0KTsNCj4gPiArDQo+ID4gKwlyZXR1cm4gcG9ydDsNCj4gPiAgfQ0KPiA+DQo+ID4gIC8q
DQo+ID4gQEAgLTE2OTcsNiArMTcwMCw5IEBAIHN0YXRpYyBpbnQgZnNsX2RpdV9wcm9iZShzdHJ1
Y3QgcGxhdGZvcm1fZGV2aWNlICpwZGV2KQ0KPiA+ICAJdW5zaWduZWQgaW50IGk7DQo+ID4gIAlp
bnQgcmV0Ow0KPiA+DQo+ID4gKwlpZiAoIWRpdV9vcHMuc2V0X3BpeGVsX2Nsb2NrKQ0KPiA+ICsJ
CXJldHVybiAtRU5PREVWOw0KPiA+ICsNCj4gPiAgCWRhdGEgPSBkbWFtX2FsbG9jX2NvaGVyZW50
KCZwZGV2LT5kZXYsIHNpemVvZihzdHJ1Y3QgZnNsX2RpdV9kYXRhKSwNCj4gPiAgCQkJCSAgICZk
bWFfYWRkciwgR0ZQX0RNQSB8IF9fR0ZQX1pFUk8pOw0KPiA+ICAJaWYgKCFkYXRhKQ0KPiA+DQo+
IA0KPiBUaGFua3MsIHF1ZXVlZCBmb3IgNC41Lg0KPiANCj4gIFRvbWkNCg0K
^ permalink raw reply [flat|nested] 23+ messages in thread
* Re: [PATCH] video: fbdev: fsl: fix kernel crash when diu_ops is not implemented
2015-11-24 6:27 [PATCH] video: fbdev: fsl: fix kernel crash when diu_ops is not implemented Dongsheng Wang
2015-11-24 10:46 ` Tomi Valkeinen
2015-11-24 11:01 ` Wang Dongsheng
@ 2015-11-24 16:04 ` Timur Tabi
2015-11-24 16:12 ` Timur Tabi
` (18 subsequent siblings)
21 siblings, 0 replies; 23+ messages in thread
From: Timur Tabi @ 2015-11-24 16:04 UTC (permalink / raw)
To: linux-fbdev
On Tue, Nov 24, 2015 at 5:46 AM, Tomi Valkeinen <tomi.valkeinen@ti.com> wrote:
> On 24/11/15 08:27, Dongsheng Wang wrote:
>> @@ -1697,6 +1700,9 @@ static int fsl_diu_probe(struct platform_device *pdev)
>> unsigned int i;
>> int ret;
>>
>> + if (!diu_ops.set_pixel_clock)
>> + return -ENODEV;
>> +
>> data = dmam_alloc_coherent(&pdev->dev, sizeof(struct fsl_diu_data),
>> &dma_addr, GFP_DMA | __GFP_ZERO);
>> if (!data)
>>
>
> Thanks, queued for 4.5.
Could you please wait for me to review the patch first? I am the
maintainer for the driver, and I see a problem with it.
^ permalink raw reply [flat|nested] 23+ messages in thread
* Re: [PATCH] video: fbdev: fsl: fix kernel crash when diu_ops is not implemented
2015-11-24 6:27 [PATCH] video: fbdev: fsl: fix kernel crash when diu_ops is not implemented Dongsheng Wang
` (2 preceding siblings ...)
2015-11-24 16:04 ` Timur Tabi
@ 2015-11-24 16:12 ` Timur Tabi
2015-11-24 16:15 ` Scott Wood
` (17 subsequent siblings)
21 siblings, 0 replies; 23+ messages in thread
From: Timur Tabi @ 2015-11-24 16:12 UTC (permalink / raw)
To: linux-fbdev
On Tue, Nov 24, 2015 at 1:27 AM, Dongsheng Wang
<dongsheng.wang@freescale.com> wrote:
> @@ -1697,6 +1700,9 @@ static int fsl_diu_probe(struct platform_device *pdev)
> unsigned int i;
> int ret;
>
> + if (!diu_ops.set_pixel_clock)
> + return -ENODEV;
> +
> data = dmam_alloc_coherent(&pdev->dev, sizeof(struct fsl_diu_data),
> &dma_addr, GFP_DMA | __GFP_ZERO);
> if (!data)
This doesn't make any sense. If set_pixel_clock() is not defined,
then the whole driver aborts the probe. When could that ever happen?
If the platform code does not exist, then don't let the driver be
probed.
^ permalink raw reply [flat|nested] 23+ messages in thread
* Re: [PATCH] video: fbdev: fsl: fix kernel crash when diu_ops is not implemented
2015-11-24 6:27 [PATCH] video: fbdev: fsl: fix kernel crash when diu_ops is not implemented Dongsheng Wang
` (3 preceding siblings ...)
2015-11-24 16:12 ` Timur Tabi
@ 2015-11-24 16:15 ` Scott Wood
2015-11-24 16:15 ` Tomi Valkeinen
` (16 subsequent siblings)
21 siblings, 0 replies; 23+ messages in thread
From: Scott Wood @ 2015-11-24 16:15 UTC (permalink / raw)
To: linux-fbdev
On Tue, 2015-11-24 at 11:12 -0500, Timur Tabi wrote:
> On Tue, Nov 24, 2015 at 1:27 AM, Dongsheng Wang
> <dongsheng.wang@freescale.com> wrote:
> > @@ -1697,6 +1700,9 @@ static int fsl_diu_probe(struct platform_device
> > *pdev)
> > unsigned int i;
> > int ret;
> >
> > + if (!diu_ops.set_pixel_clock)
> > + return -ENODEV;
> > +
> > data = dmam_alloc_coherent(&pdev->dev, sizeof(struct
> > fsl_diu_data),
> > &dma_addr, GFP_DMA | __GFP_ZERO);
> > if (!data)
>
> This doesn't make any sense. If set_pixel_clock() is not defined,
> then the whole driver aborts the probe.
That's what this patch is trying to accomplish. Currently it crashes instead.
> When could that ever happen?
> If the platform code does not exist, then don't let the driver be
> probed.
How do you propose to accomplish that other than with such a check?
-Scott
^ permalink raw reply [flat|nested] 23+ messages in thread
* Re: [PATCH] video: fbdev: fsl: fix kernel crash when diu_ops is not implemented
2015-11-24 6:27 [PATCH] video: fbdev: fsl: fix kernel crash when diu_ops is not implemented Dongsheng Wang
` (4 preceding siblings ...)
2015-11-24 16:15 ` Scott Wood
@ 2015-11-24 16:15 ` Tomi Valkeinen
2015-11-24 16:54 ` Timur Tabi
` (15 subsequent siblings)
21 siblings, 0 replies; 23+ messages in thread
From: Tomi Valkeinen @ 2015-11-24 16:15 UTC (permalink / raw)
To: linux-fbdev
[-- Attachment #1: Type: text/plain, Size: 920 bytes --]
On 24/11/15 18:04, Timur Tabi wrote:
> On Tue, Nov 24, 2015 at 5:46 AM, Tomi Valkeinen <tomi.valkeinen@ti.com> wrote:
>> On 24/11/15 08:27, Dongsheng Wang wrote:
>>> @@ -1697,6 +1700,9 @@ static int fsl_diu_probe(struct platform_device *pdev)
>>> unsigned int i;
>>> int ret;
>>>
>>> + if (!diu_ops.set_pixel_clock)
>>> + return -ENODEV;
>>> +
>>> data = dmam_alloc_coherent(&pdev->dev, sizeof(struct fsl_diu_data),
>>> &dma_addr, GFP_DMA | __GFP_ZERO);
>>> if (!data)
>>>
>>
>> Thanks, queued for 4.5.
>
> Could you please wait for me to review the patch first? I am the
> maintainer for the driver, and I see a problem with it.
Sorry, I was too hasty (and tired). I thought I was looking at a patch
that's been on the list for a while, but apparently it was only posted
today...
Anyway, dropped this.
Tomi
[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 819 bytes --]
^ permalink raw reply [flat|nested] 23+ messages in thread
* Re: [PATCH] video: fbdev: fsl: fix kernel crash when diu_ops is not implemented
2015-11-24 6:27 [PATCH] video: fbdev: fsl: fix kernel crash when diu_ops is not implemented Dongsheng Wang
` (5 preceding siblings ...)
2015-11-24 16:15 ` Tomi Valkeinen
@ 2015-11-24 16:54 ` Timur Tabi
2015-11-24 16:55 ` Scott Wood
` (14 subsequent siblings)
21 siblings, 0 replies; 23+ messages in thread
From: Timur Tabi @ 2015-11-24 16:54 UTC (permalink / raw)
To: linux-fbdev
On Tue, Nov 24, 2015 at 11:15 AM, Scott Wood <scottwood@freescale.com> wrote:
> On Tue, 2015-11-24 at 11:12 -0500, Timur Tabi wrote:
>> On Tue, Nov 24, 2015 at 1:27 AM, Dongsheng Wang
>> <dongsheng.wang@freescale.com> wrote:
>> > @@ -1697,6 +1700,9 @@ static int fsl_diu_probe(struct platform_device
>> > *pdev)
>> > unsigned int i;
>> > int ret;
>> >
>> > + if (!diu_ops.set_pixel_clock)
>> > + return -ENODEV;
>> > +
>> > data = dmam_alloc_coherent(&pdev->dev, sizeof(struct
>> > fsl_diu_data),
>> > &dma_addr, GFP_DMA | __GFP_ZERO);
>> > if (!data)
>>
>> This doesn't make any sense. If set_pixel_clock() is not defined,
>> then the whole driver aborts the probe.
>
> That's what this patch is trying to accomplish. Currently it crashes instead.
>
>> When could that ever happen?
>> If the platform code does not exist, then don't let the driver be
>> probed.
>
> How do you propose to accomplish that other than with such a check?
Well, if you're concern is that there's no platform code, then there
should be a check that says, "see if there's any platform code", not
"let's check this obscure function and abort without explanation if
it's not initialized."
Alternatively, why can't you just do this, in update_lcdc():
>
> -Scott
>
> --
> To unsubscribe from this list: send the line "unsubscribe linux-fbdev" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at http://vger.kernel.org/majordomo-info.html
^ permalink raw reply [flat|nested] 23+ messages in thread
* Re: [PATCH] video: fbdev: fsl: fix kernel crash when diu_ops is not implemented
2015-11-24 6:27 [PATCH] video: fbdev: fsl: fix kernel crash when diu_ops is not implemented Dongsheng Wang
` (6 preceding siblings ...)
2015-11-24 16:54 ` Timur Tabi
@ 2015-11-24 16:55 ` Scott Wood
2015-11-24 16:56 ` Timur Tabi
` (13 subsequent siblings)
21 siblings, 0 replies; 23+ messages in thread
From: Scott Wood @ 2015-11-24 16:55 UTC (permalink / raw)
To: linux-fbdev
On Tue, 2015-11-24 at 11:54 -0500, Timur Tabi wrote:
> On Tue, Nov 24, 2015 at 11:15 AM, Scott Wood <scottwood@freescale.com>
> wrote:
> > On Tue, 2015-11-24 at 11:12 -0500, Timur Tabi wrote:
> > > On Tue, Nov 24, 2015 at 1:27 AM, Dongsheng Wang
> > > <dongsheng.wang@freescale.com> wrote:
> > > > @@ -1697,6 +1700,9 @@ static int fsl_diu_probe(struct platform_device
> > > > *pdev)
> > > > unsigned int i;
> > > > int ret;
> > > >
> > > > + if (!diu_ops.set_pixel_clock)
> > > > + return -ENODEV;
> > > > +
> > > > data = dmam_alloc_coherent(&pdev->dev, sizeof(struct
> > > > fsl_diu_data),
> > > > &dma_addr, GFP_DMA | __GFP_ZERO);
> > > > if (!data)
> > >
> > > This doesn't make any sense. If set_pixel_clock() is not defined,
> > > then the whole driver aborts the probe.
> >
> > That's what this patch is trying to accomplish. Currently it crashes
> > instead.
> >
> > > When could that ever happen?
> > > If the platform code does not exist, then don't let the driver be
> > > probed.
> >
> > How do you propose to accomplish that other than with such a check?
>
> Well, if you're concern is that there's no platform code, then there
> should be a check that says, "see if there's any platform code", not
> "let's check this obscure function and abort without explanation if
> it's not initialized."
Do you have a *specific* better way to "see if there's any platform code"?
>
> Alternatively, why can't you just do this, in update_lcdc():
>
>
>
Do nothing?
-Scott
^ permalink raw reply [flat|nested] 23+ messages in thread
* Re: [PATCH] video: fbdev: fsl: fix kernel crash when diu_ops is not implemented
2015-11-24 6:27 [PATCH] video: fbdev: fsl: fix kernel crash when diu_ops is not implemented Dongsheng Wang
` (7 preceding siblings ...)
2015-11-24 16:55 ` Scott Wood
@ 2015-11-24 16:56 ` Timur Tabi
2015-11-24 16:57 ` Wang Dongsheng
` (12 subsequent siblings)
21 siblings, 0 replies; 23+ messages in thread
From: Timur Tabi @ 2015-11-24 16:56 UTC (permalink / raw)
To: linux-fbdev
On Tue, Nov 24, 2015 at 11:54 AM, Timur Tabi <timur@tabi.org> wrote:
> Well, if you're concern is that there's no platform code, then there
> should be a check that says, "see if there's any platform code", not
> "let's check this obscure function and abort without explanation if
> it's not initialized."
>
> Alternatively, why can't you just do this, in update_lcdc():
[Stupid gmail sent my message before I was done typing]
if (diu_ops.set_pixel_clock)
diu_ops.set_pixel_clock(var->pixclock);
^ permalink raw reply [flat|nested] 23+ messages in thread
* RE: [PATCH] video: fbdev: fsl: fix kernel crash when diu_ops is not implemented
2015-11-24 6:27 [PATCH] video: fbdev: fsl: fix kernel crash when diu_ops is not implemented Dongsheng Wang
` (8 preceding siblings ...)
2015-11-24 16:56 ` Timur Tabi
@ 2015-11-24 16:57 ` Wang Dongsheng
2015-11-24 16:59 ` Scott Wood
` (11 subsequent siblings)
21 siblings, 0 replies; 23+ messages in thread
From: Wang Dongsheng @ 2015-11-24 16:57 UTC (permalink / raw)
To: linux-fbdev
SGkgVGltdXIsDQoNClRoYW5rcyBmb3IgeW91ciByZXZpZXcuDQoNCj4gIE9uIFR1ZSwgTm92IDI0
LCAyMDE1IGF0IDE6MjcgQU0sIERvbmdzaGVuZyBXYW5nDQo+IDxkb25nc2hlbmcud2FuZ0BmcmVl
c2NhbGUuY29tPiB3cm90ZToNCj4gPiBAQCAtMTY5Nyw2ICs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phdGlvbiB3aWxsIGJlIGNvbXBsZXRlZCBp
biB0aGUgcHJvYmUNCmluY2x1ZGUgdGhpcyBjaGVjay4gU28ganVzdCBkbyBhIHF1aWNrIGZpeCBm
b3IgdGhpcyBib290IGtlcm5lbCBjcmFzaCBpc3N1ZS4NCg0KUmVnYXJkcywNCi1Eb25nc2hlbmcN
Cg=
^ permalink raw reply [flat|nested] 23+ messages in thread
* Re: [PATCH] video: fbdev: fsl: fix kernel crash when diu_ops is not implemented
2015-11-24 6:27 [PATCH] video: fbdev: fsl: fix kernel crash when diu_ops is not implemented Dongsheng Wang
` (9 preceding siblings ...)
2015-11-24 16:57 ` Wang Dongsheng
@ 2015-11-24 16:59 ` Scott Wood
2015-11-24 17:00 ` Scott Wood
` (10 subsequent siblings)
21 siblings, 0 replies; 23+ messages in thread
From: Scott Wood @ 2015-11-24 16:59 UTC (permalink / raw)
To: linux-fbdev
On Tue, 2015-11-24 at 18:15 +0200, Tomi Valkeinen wrote:
>
> On 24/11/15 18:04, Timur Tabi wrote:
> > On Tue, Nov 24, 2015 at 5:46 AM, Tomi Valkeinen <tomi.valkeinen@ti.com>
> > wrote:
> > > On 24/11/15 08:27, Dongsheng Wang wrote:
> > > > @@ -1697,6 +1700,9 @@ static int fsl_diu_probe(struct platform_device
> > > > *pdev)
> > > > unsigned int i;
> > > > int ret;
> > > >
> > > > + if (!diu_ops.set_pixel_clock)
> > > > + return -ENODEV;
> > > > +
> > > > data = dmam_alloc_coherent(&pdev->dev, sizeof(struct
> > > > fsl_diu_data),
> > > > &dma_addr, GFP_DMA | __GFP_ZERO);
> > > > if (!data)
> > > >
> > >
> > > Thanks, queued for 4.5.
> >
> > Could you please wait for me to review the patch first? I am the
> > maintainer for the driver, and I see a problem with it.
>
> Sorry, I was too hasty (and tired). I thought I was looking at a patch
> that's been on the list for a while, but apparently it was only posted
> today...
>
> Anyway, dropped this.
Also, this is a bugfix (certain platforms are currently crashing on boot) and
once review is settled should go into 4.4.
-Scott
^ permalink raw reply [flat|nested] 23+ messages in thread
* Re: [PATCH] video: fbdev: fsl: fix kernel crash when diu_ops is not implemented
2015-11-24 6:27 [PATCH] video: fbdev: fsl: fix kernel crash when diu_ops is not implemented Dongsheng Wang
` (10 preceding siblings ...)
2015-11-24 16:59 ` Scott Wood
@ 2015-11-24 17:00 ` Scott Wood
2015-11-24 17:02 ` Timur Tabi
` (9 subsequent siblings)
21 siblings, 0 replies; 23+ messages in thread
From: Scott Wood @ 2015-11-24 17:00 UTC (permalink / raw)
To: linux-fbdev
On Tue, 2015-11-24 at 11:56 -0500, Timur Tabi wrote:
> On Tue, Nov 24, 2015 at 11:54 AM, Timur Tabi <timur@tabi.org> wrote:
> > Well, if you're concern is that there's no platform code, then there
> > should be a check that says, "see if there's any platform code", not
> > "let's check this obscure function and abort without explanation if
> > it's not initialized."
> >
> > Alternatively, why can't you just do this, in update_lcdc():
>
> [Stupid gmail sent my message before I was done typing]
>
> if (diu_ops.set_pixel_clock)
> diu_ops.set_pixel_clock(var->pixclock);
Because it's more obviously correct to abort the probe than to continue with
some operations nooped. This is meant to be a quick and obvious fix to the
crashing bug. There's another patch pending to reorganize the init of this
driver.
FWIW, I don't like the fact that this driver requires "platform code" at all.
Why isn't it self-contained, with knowledge of the relevant boards?
-Scott
^ permalink raw reply [flat|nested] 23+ messages in thread
* Re: [PATCH] video: fbdev: fsl: fix kernel crash when diu_ops is not implemented
2015-11-24 6:27 [PATCH] video: fbdev: fsl: fix kernel crash when diu_ops is not implemented Dongsheng Wang
` (11 preceding siblings ...)
2015-11-24 17:00 ` Scott Wood
@ 2015-11-24 17:02 ` Timur Tabi
2015-11-24 17:02 ` Wang Dongsheng
` (8 subsequent siblings)
21 siblings, 0 replies; 23+ messages in thread
From: Timur Tabi @ 2015-11-24 17:02 UTC (permalink / raw)
To: linux-fbdev
On Tue, Nov 24, 2015 at 11:55 AM, Scott Wood <scottwood@freescale.com> wrote:
>> Well, if you're concern is that there's no platform code, then there
>> should be a check that says, "see if there's any platform code", not
>> "let's check this obscure function and abort without explanation if
>> it's not initialized."
>
> Do you have a *specific* better way to "see if there's any platform code"?
Well, for one thing, the check should be done in the _init function,
not the _probe. Secondly, it should be documented as such, e.g. "/*
Check to see that we have platform code that initializes diu_ops. If
not, then abort. */". Third, you should probably add a boolean field
to platform_diu_data_ops that gets set to True if/when the platform
code initializes the rest of the structure.
Of course, an even better solution would be to get rid of the global
structure altogether and come up with something more robust, but I
understand that that's overkill.
^ permalink raw reply [flat|nested] 23+ messages in thread
* RE: [PATCH] video: fbdev: fsl: fix kernel crash when diu_ops is not implemented
2015-11-24 6:27 [PATCH] video: fbdev: fsl: fix kernel crash when diu_ops is not implemented Dongsheng Wang
` (12 preceding siblings ...)
2015-11-24 17:02 ` Timur Tabi
@ 2015-11-24 17:02 ` Wang Dongsheng
2015-11-24 17:05 ` Timur Tabi
` (7 subsequent siblings)
21 siblings, 0 replies; 23+ messages in thread
From: Wang Dongsheng @ 2015-11-24 17:02 UTC (permalink / raw)
To: linux-fbdev
PiBPbiBUdWUsIE5vdiAyNCwgMjAxNSBhdCAxMTo1NCBBTSwgVGltdXIgVGFiaSA8dGltdXJAdGFi
aS5vcmc+IHdyb3RlOg0KPiA+IFdlbGwsIGlmIHlvdSdyZSBjb25jZXJuIGlzIHRoYXQgdGhlcmUn
cyBubyBwbGF0Zm9ybSBjb2RlLCB0aGVuIHRoZXJlDQo+ID4gc2hvdWxkIGJlIGEgY2hlY2sgdGhh
dCBzYXlzLCAic2VlIGlmIHRoZXJlJ3MgYW55IHBsYXRmb3JtIGNvZGUiLCBub3QNCj4gPiAibGV0
J3MgY2hlY2sgdGhpcyBvYnNjdXJlIGZ1bmN0aW9uIGFuZCBhYm9ydCB3aXRob3V0IGV4cGxhbmF0
aW9uIGlmDQo+ID4gaXQncyBub3QgaW5pdGlhbGl6ZWQuIg0KPiA+DQo+ID4gQWx0ZXJuYXRpdmVs
eSwgd2h5IGNhbid0IHlvdSBqdXN0IGRvIHRoaXMsIGluIHVwZGF0ZV9sY2RjKCk6DQo+IA0KPiBb
U3R1cGlkIGdtYWlsIHNlbnQgbXkgbWVzc2FnZSBiZWZvcmUgSSB3YXMgZG9uZSB0eXBpbmddDQo+
IA0KPiBpZiAoZGl1X29wcy5zZXRfcGl4ZWxfY2xvY2spDQo+ICAgIGRpdV9vcHMuc2V0X3BpeGVs
X2Nsb2NrKHZhci0+cGl4Y2xvY2spOw0KDQpIZXJlIGFyZSBub3QgZnJpZW5kbHkgZm9yIGtlcm5l
bCwgYmVjYXVzZSBpZiB3ZSBsb3N0IHRoZSBjbG9jayB3ZSBjYW5ub3QNCnRvIGRpc3BsYXkuIFdl
IGRvIHNvIG11Y2ggdGhpbmdzIGluIGtlcm5lbCBidXQgd2Ugc3RpbGwgY2Fubm90IHRvIGRpc3Bs
YXkgdGhhdA0KaXMgYmVmb3JlIHdlIGNhbiBrbm93IGl0Li4uU28gc3RpbGwgdGhpbmsgd2UgbmVl
ZCB0byBjaGVjayB0aGUgaG9vayBpbiBpbml0aWFsaXphdGlvbg0KZmxvdy4NCg0KUmVnYXJkcywN
Ci1Eb25nc2hlbmcNCg=
^ permalink raw reply [flat|nested] 23+ messages in thread
* Re: [PATCH] video: fbdev: fsl: fix kernel crash when diu_ops is not implemented
2015-11-24 6:27 [PATCH] video: fbdev: fsl: fix kernel crash when diu_ops is not implemented Dongsheng Wang
` (13 preceding siblings ...)
2015-11-24 17:02 ` Wang Dongsheng
@ 2015-11-24 17:05 ` Timur Tabi
2015-11-24 17:05 ` Scott Wood
` (6 subsequent siblings)
21 siblings, 0 replies; 23+ messages in thread
From: Timur Tabi @ 2015-11-24 17:05 UTC (permalink / raw)
To: linux-fbdev
On Tue, Nov 24, 2015 at 12:00 PM, Scott Wood <scottwood@freescale.com> wrote:
>
> FWIW, I don't like the fact that this driver requires "platform code" at all.
> Why isn't it self-contained, with knowledge of the relevant boards?
Yeah, I was never crazy about that either. To make the change you
want, we would need Dongsheng's other patch that moves all hardware
init into the _probe function first. And then we would need to get
rid of the #ifdefs for 5121. I'm all for that, but at the time this
code was written, no one expected Freescale to continue using the DIU
after the P1022.
^ permalink raw reply [flat|nested] 23+ messages in thread
* Re: [PATCH] video: fbdev: fsl: fix kernel crash when diu_ops is not implemented
2015-11-24 6:27 [PATCH] video: fbdev: fsl: fix kernel crash when diu_ops is not implemented Dongsheng Wang
` (14 preceding siblings ...)
2015-11-24 17:05 ` Timur Tabi
@ 2015-11-24 17:05 ` Scott Wood
2015-11-24 17:06 ` Timur Tabi
` (5 subsequent siblings)
21 siblings, 0 replies; 23+ messages in thread
From: Scott Wood @ 2015-11-24 17:05 UTC (permalink / raw)
To: linux-fbdev
On Tue, 2015-11-24 at 12:02 -0500, Timur Tabi wrote:
> On Tue, Nov 24, 2015 at 11:55 AM, Scott Wood <scottwood@freescale.com>
> wrote:
>
> > > Well, if you're concern is that there's no platform code, then there
> > > should be a check that says, "see if there's any platform code", not
> > > "let's check this obscure function and abort without explanation if
> > > it's not initialized."
> >
> > Do you have a *specific* better way to "see if there's any platform code"?
>
> Well, for one thing, the check should be done in the _init function,
> not the _probe.
I asked Dongsheng to put it in probe() during internal review because at the
time he was printing an error, and I didn't want the error to be printed if
the device wasn't present. Again, there's another non-bugfix patch pending
that moves all the rest into probe() where it belongs.
> Secondly, it should be documented as such, e.g. "/*
> Check to see that we have platform code that initializes diu_ops. If
> not, then abort. */".
OK.
> Third, you should probably add a boolean field
> to platform_diu_data_ops that gets set to True if/when the platform
> code initializes the rest of the structure.
Why do you want to complicate a simple bugfix with a requirement to modify all
platforms that use the driver, introducing a possible regression if one is
missed?
-Scott
^ permalink raw reply [flat|nested] 23+ messages in thread
* Re: [PATCH] video: fbdev: fsl: fix kernel crash when diu_ops is not implemented
2015-11-24 6:27 [PATCH] video: fbdev: fsl: fix kernel crash when diu_ops is not implemented Dongsheng Wang
` (15 preceding siblings ...)
2015-11-24 17:05 ` Scott Wood
@ 2015-11-24 17:06 ` Timur Tabi
2015-11-24 17:10 ` Scott Wood
` (4 subsequent siblings)
21 siblings, 0 replies; 23+ messages in thread
From: Timur Tabi @ 2015-11-24 17:06 UTC (permalink / raw)
To: linux-fbdev
On Tue, Nov 24, 2015 at 12:02 PM, Wang Dongsheng
<Dongsheng.Wang@freescale.com> wrote:
>
> Here are not friendly for kernel, because if we lost the clock we cannot
> to display. We do so much things in kernel but we still cannot to display that
> is before we can know it...So still think we need to check the hook in initialization
> flow.
Ok, I agree with that. But the check has to be more obvious, and I
think it should be done in the _init code.
^ permalink raw reply [flat|nested] 23+ messages in thread
* Re: [PATCH] video: fbdev: fsl: fix kernel crash when diu_ops is not implemented
2015-11-24 6:27 [PATCH] video: fbdev: fsl: fix kernel crash when diu_ops is not implemented Dongsheng Wang
` (16 preceding siblings ...)
2015-11-24 17:06 ` Timur Tabi
@ 2015-11-24 17:10 ` Scott Wood
2015-11-24 17:16 ` Timur Tabi
` (3 subsequent siblings)
21 siblings, 0 replies; 23+ messages in thread
From: Scott Wood @ 2015-11-24 17:10 UTC (permalink / raw)
To: linux-fbdev
On Tue, 2015-11-24 at 10:59 -0600, Scott Wood wrote:
> On Tue, 2015-11-24 at 18:15 +0200, Tomi Valkeinen wrote:
> >
> > On 24/11/15 18:04, Timur Tabi wrote:
> > > On Tue, Nov 24, 2015 at 5:46 AM, Tomi Valkeinen <tomi.valkeinen@ti.com>
> > > wrote:
> > > > On 24/11/15 08:27, Dongsheng Wang wrote:
> > > > > @@ -1697,6 +1700,9 @@ static int fsl_diu_probe(struct
> > > > > platform_device
> > > > > *pdev)
> > > > > unsigned int i;
> > > > > int ret;
> > > > >
> > > > > + if (!diu_ops.set_pixel_clock)
> > > > > + return -ENODEV;
> > > > > +
> > > > > data = dmam_alloc_coherent(&pdev->dev, sizeof(struct
> > > > > fsl_diu_data),
> > > > > &dma_addr, GFP_DMA | __GFP_ZERO);
> > > > > if (!data)
> > > > >
> > > >
> > > > Thanks, queued for 4.5.
> > >
> > > Could you please wait for me to review the patch first? I am the
> > > maintainer for the driver, and I see a problem with it.
> >
> > Sorry, I was too hasty (and tired). I thought I was looking at a patch
> > that's been on the list for a while, but apparently it was only posted
> > today...
> >
> > Anyway, dropped this.
>
> Also, this is a bugfix (certain platforms are currently crashing on boot)
> and
> once review is settled should go into 4.4.
...and stable, since the defconfig changes that enabled this driver on the
problematic platforms went into 4.3.
-Scott
^ permalink raw reply [flat|nested] 23+ messages in thread
* Re: [PATCH] video: fbdev: fsl: fix kernel crash when diu_ops is not implemented
2015-11-24 6:27 [PATCH] video: fbdev: fsl: fix kernel crash when diu_ops is not implemented Dongsheng Wang
` (17 preceding siblings ...)
2015-11-24 17:10 ` Scott Wood
@ 2015-11-24 17:16 ` Timur Tabi
2015-11-24 17:17 ` Scott Wood
` (2 subsequent siblings)
21 siblings, 0 replies; 23+ messages in thread
From: Timur Tabi @ 2015-11-24 17:16 UTC (permalink / raw)
To: linux-fbdev
On Tue, Nov 24, 2015 at 12:05 PM, Scott Wood <scottwood@freescale.com> wrote:
> I asked Dongsheng to put it in probe() during internal review because at the
> time he was printing an error, and I didn't want the error to be printed if
> the device wasn't present. Again, there's another non-bugfix patch pending
> that moves all the rest into probe() where it belongs.
I think it should be in _init, and not display an error.
>> Third, you should probably add a boolean field
>> to platform_diu_data_ops that gets set to True if/when the platform
>> code initializes the rest of the structure.
>
> Why do you want to complicate a simple bugfix with a requirement to modify all
> platforms that use the driver, introducing a possible regression if one is
> missed?
Fair enough, but I think it should at least be documented by saying
something about set_pixel_clock must be defined, so if it isn't, then
that means the platform code does not support DIU at all, so just
abort.
^ permalink raw reply [flat|nested] 23+ messages in thread
* Re: [PATCH] video: fbdev: fsl: fix kernel crash when diu_ops is not implemented
2015-11-24 6:27 [PATCH] video: fbdev: fsl: fix kernel crash when diu_ops is not implemented Dongsheng Wang
` (18 preceding siblings ...)
2015-11-24 17:16 ` Timur Tabi
@ 2015-11-24 17:17 ` Scott Wood
2015-12-01 8:43 ` Wang Dongsheng
2015-12-01 14:53 ` Timur Tabi
21 siblings, 0 replies; 23+ messages in thread
From: Scott Wood @ 2015-11-24 17:17 UTC (permalink / raw)
To: linux-fbdev
On Tue, 2015-11-24 at 12:16 -0500, Timur Tabi wrote:
> On Tue, Nov 24, 2015 at 12:05 PM, Scott Wood <scottwood@freescale.com>
> wrote:
>
> > I asked Dongsheng to put it in probe() during internal review because at
> > the
> > time he was printing an error, and I didn't want the error to be printed
> > if
> > the device wasn't present. Again, there's another non-bugfix patch
> > pending
> > that moves all the rest into probe() where it belongs.
>
> I think it should be in _init, and not display an error.
As long as it doesn't display anything I don't care much either way.
> > > Third, you should probably add a boolean field
> > > to platform_diu_data_ops that gets set to True if/when the platform
> > > code initializes the rest of the structure.
> >
> > Why do you want to complicate a simple bugfix with a requirement to modify
> > all
> > platforms that use the driver, introducing a possible regression if one is
> > missed?
>
> Fair enough, but I think it should at least be documented by saying
> something about set_pixel_clock must be defined, so if it isn't, then
> that means the platform code does not support DIU at all, so just
> abort.
Sure.
-Scott
^ permalink raw reply [flat|nested] 23+ messages in thread
* RE: [PATCH] video: fbdev: fsl: fix kernel crash when diu_ops is not implemented
2015-11-24 6:27 [PATCH] video: fbdev: fsl: fix kernel crash when diu_ops is not implemented Dongsheng Wang
` (19 preceding siblings ...)
2015-11-24 17:17 ` Scott Wood
@ 2015-12-01 8:43 ` Wang Dongsheng
2015-12-01 14:53 ` Timur Tabi
21 siblings, 0 replies; 23+ messages in thread
From: Wang Dongsheng @ 2015-12-01 8:43 UTC (permalink / raw)
To: linux-fbdev
PiBPbiBUdWUsIDIwMTUtMTEtMjQgYXQgMTI6MTYgLTA1MDAsIFRpbXVyIFRhYmkgd3JvdGU6DQo+
ID4gT24gVHVlLCBOb3YgMjQsIDIwMTUgYXQgMTI6MDUgUE0sIFNjb3R0IFdvb2QgPHNjb3R0d29v
ZEBmcmVlc2NhbGUuY29tPg0KPiA+IHdyb3RlOg0KPiA+DQo+ID4gPiBJIGFza2VkIERvbmdzaGVu
ZyB0byBwdXQgaXQgaW4gcHJvYmUoKSBkdXJpbmcgaW50ZXJuYWwgcmV2aWV3DQo+ID4gPiBiZWNh
dXNlIGF0IHRoZSB0aW1lIGhlIHdhcyBwcmludGluZyBhbiBlcnJvciwgYW5kIEkgZGlkbid0IHdh
bnQgdGhlDQo+ID4gPiBlcnJvciB0byBiZSBwcmludGVkIGlmIHRoZSBkZXZpY2Ugd2Fzbid0IHBy
ZXNlbnQuICBBZ2FpbiwgdGhlcmUncw0KPiA+ID4gYW5vdGhlciBub24tYnVnZml4IHBhdGNoIHBl
bmRpbmcgdGhhdCBtb3ZlcyBhbGwgdGhlIHJlc3QgaW50bw0KPiA+ID4gcHJvYmUoKSB3aGVyZSBp
dCBiZWxvbmdzLg0KPiA+DQo+ID4gSSB0aGluayBpdCBzaG91bGQgYmUgaW4gX2luaXQsIGFuZCBu
b3QgZGlzcGxheSBhbiBlcnJvci4NCj4gDQo+IEFzIGxvbmcgYXMgaXQgZG9lc24ndCBkaXNwbGF5
IGFueXRoaW5nIEkgZG9uJ3QgY2FyZSBtdWNoIGVpdGhlciB3YXkuDQo+IA0KDQpTbyB3ZSBtb3Zl
IHRoZSBjb2RlIHRvIF9pbml0PyBJZiB3ZSBhcmUgY29uc2lzdGVudCBJIHdpbGwgbW92ZSB0byBf
aW5pdA0KYW5kIHNlbmQgdjIgcGF0Y2guDQoNClJlZ2FyZHMsDQotRG9uZ3NoZW5nDQo
^ permalink raw reply [flat|nested] 23+ messages in thread
* Re: [PATCH] video: fbdev: fsl: fix kernel crash when diu_ops is not implemented
2015-11-24 6:27 [PATCH] video: fbdev: fsl: fix kernel crash when diu_ops is not implemented Dongsheng Wang
` (20 preceding siblings ...)
2015-12-01 8:43 ` Wang Dongsheng
@ 2015-12-01 14:53 ` Timur Tabi
21 siblings, 0 replies; 23+ messages in thread
From: Timur Tabi @ 2015-12-01 14:53 UTC (permalink / raw)
To: linux-fbdev
Wang Dongsheng wrote:
> So we move the code to _init? If we are consistent I will move to _init
> and send v2 patch.
Yes, please.
^ permalink raw reply [flat|nested] 23+ messages in thread
end of thread, other threads:[~2015-12-01 14:53 UTC | newest]
Thread overview: 23+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2015-11-24 6:27 [PATCH] video: fbdev: fsl: fix kernel crash when diu_ops is not implemented Dongsheng Wang
2015-11-24 10:46 ` Tomi Valkeinen
2015-11-24 11:01 ` Wang Dongsheng
2015-11-24 16:04 ` Timur Tabi
2015-11-24 16:12 ` Timur Tabi
2015-11-24 16:15 ` Scott Wood
2015-11-24 16:15 ` Tomi Valkeinen
2015-11-24 16:54 ` Timur Tabi
2015-11-24 16:55 ` Scott Wood
2015-11-24 16:56 ` Timur Tabi
2015-11-24 16:57 ` Wang Dongsheng
2015-11-24 16:59 ` Scott Wood
2015-11-24 17:00 ` Scott Wood
2015-11-24 17:02 ` Timur Tabi
2015-11-24 17:02 ` Wang Dongsheng
2015-11-24 17:05 ` Timur Tabi
2015-11-24 17:05 ` Scott Wood
2015-11-24 17:06 ` Timur Tabi
2015-11-24 17:10 ` Scott Wood
2015-11-24 17:16 ` Timur Tabi
2015-11-24 17:17 ` Scott Wood
2015-12-01 8:43 ` Wang Dongsheng
2015-12-01 14:53 ` Timur Tabi
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).