[PATCH] davincifb driver fix

Previous Topic
 
classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

[PATCH] davincifb driver fix

Sameer Naik
Hi,
Please find attached a fix to davincifb.c.
I am new to git and am not aware of the procedure to be followed while
submitting patches. I have generated the by doing
$ git diff > davincifb.patch

If i need to follow a particular procedure while submitting patches
please guide me in doing so. Following is the patch description
---
ISSUE: If a window other than VID0 is disabled at boot time, then the
kernel wont boot.
Through my investigation is found that illegal accesses are made to
the disabled windows in davincifb_isr(), for example if VID1 is
disabled then an access is still made via xchg(&addr,
dm->vid1->sdram_address) in davinfb_isr() due to which the kernel
won't boot as dm->vid1 is NULL.

The patch adds a check to verify that the dm->{osd0,osd1,vid1}
variables are not NULL before the access is made. the check is not
added for VID0 window because if VID0 is disabled then all the windows
are disabled and the ISR itself is not registered.

I have tested this patch on dm6446 at PAL COMPOSITE resolution.

diff --git a/drivers/video/davincifb.c b/drivers/video/davincifb.c
index 1344be7..199c335 100644
--- a/drivers/video/davincifb.c
+++ b/drivers/video/davincifb.c
@@ -295,20 +295,26 @@ static irqreturn_t davincifb_isr(int irq, void *arg)
  unsigned long addr=0;

  if ((dispc_reg_in(VENC_VSTAT) & 0x00000010) == 0x10) {
- xchg(&addr, dm->osd0->sdram_address);
- if (addr) {
- set_sdram_params(dm->osd0->info.fix.id,
- dm->osd0->sdram_address,
- dm->osd0->info.fix.line_length);
- dm->osd0->sdram_address = 0;
+ if (dm->osd0)
+ {
+ xchg(&addr, dm->osd0->sdram_address);
+ if (addr) {
+ set_sdram_params(dm->osd0->info.fix.id,
+ dm->osd0->sdram_address,
+ dm->osd0->info.fix.line_length);
+ dm->osd0->sdram_address = 0;
+ }
  }
- addr = 0;
- xchg(&addr, dm->osd1->sdram_address);
- if (addr) {
- set_sdram_params(dm->osd1->info.fix.id,
- dm->osd1->sdram_address,
- dm->osd1->info.fix.line_length);
- dm->osd1->sdram_address = 0;
+ if (dm->osd1)
+ {
+ addr = 0;
+ xchg(&addr, dm->osd1->sdram_address);
+ if (addr) {
+ set_sdram_params(dm->osd1->info.fix.id,
+ dm->osd1->sdram_address,
+ dm->osd1->info.fix.line_length);
+ dm->osd1->sdram_address = 0;
+ }
  }
  addr = 0;
  xchg(&addr, dm->vid0->sdram_address);
@@ -318,13 +324,16 @@ static irqreturn_t davincifb_isr(int irq, void *arg)
  dm->vid0->info.fix.line_length);
  dm->vid0->sdram_address = 0;
  }
- addr = 0;
- xchg(&addr, dm->vid1->sdram_address);
- if (addr) {
- set_sdram_params(dm->vid1->info.fix.id,
- dm->vid1->sdram_address,
- dm->vid1->info.fix.line_length);
- dm->vid1->sdram_address = 0;
+ if (dm->vid1)
+ {
+ addr = 0;
+ xchg(&addr, dm->vid1->sdram_address);
+ if (addr) {
+ set_sdram_params(dm->vid1->info.fix.id,
+ dm->vid1->sdram_address,
+ dm->vid1->info.fix.line_length);
+ dm->vid1->sdram_address = 0;
+ }
  }
  return IRQ_HANDLED;
  } else {

Regards
~Sameer
-------------- next part --------------
A non-text attachment was scrubbed...
Name: davincifb.patch
Type: text/x-patch
Size: 1954 bytes
Desc: not available
Url : http://linux.omap.com/pipermail/davinci-linux-open-source/attachments/20091102/c1ee5fad/davincifb.bin
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

[PATCH] davincifb driver fix

Nori, Sekhar
Hello,

On Mon, Nov 02, 2009 at 00:18:28, Sameer Naik wrote:
> Hi,
> Please find attached a fix to davincifb.c.
> I am new to git and am not aware of the procedure to be followed while
> submitting patches. I have generated the by doing
> $ git diff > davincifb.patch
>
> If i need to follow a particular procedure while submitting patches
> please guide me in doing so. Following is the patch description

You should instead commit your changes (git-commit), prepare
a patch using git-format-patch and send using git-send-email

> ---
> ISSUE: If a window other than VID0 is disabled at boot time, then the
> kernel wont boot.
> Through my investigation is found that illegal accesses are made to
> the disabled windows in davincifb_isr(), for example if VID1 is
> disabled then an access is still made via xchg(&addr,
> dm->vid1->sdram_address) in davinfb_isr() due to which the kernel
> won't boot as dm->vid1 is NULL.
>
> The patch adds a check to verify that the dm->{osd0,osd1,vid1}
> variables are not NULL before the access is made. the check is not
> added for VID0 window because if VID0 is disabled then all the windows
> are disabled and the ISR itself is not registered.
>
> I have tested this patch on dm6446 at PAL COMPOSITE resolution.

This part looks like the actual patch description and should
be above the '---'. git-format-patch automatically makes the
commit message as subject + patch description.

Your current subject could also be more descriptive, IMO.

Thanks,
Sekhar

Loading...