linux-arm-kernel.lists.infradead.org archive mirror
 help / color / mirror / Atom feed
From: richard.purdie@linuxfoundation.org (Richard Purdie)
To: linux-arm-kernel@lists.infradead.org
Subject: [RFC][PATCH] Disintegrate sharpsl_param.c
Date: Wed, 22 Aug 2012 20:19:42 +0100	[thread overview]
Message-ID: <1345663182.3907.134.camel@ted> (raw)
In-Reply-To: <1345656424-31234-1-git-send-email-dromede@gmail.com>

On Wed, 2012-08-22 at 19:27 +0200, dromede at gmail.com wrote:
> From: Marko Katic <dromede.gmail.com>
>
> I recently tried running 3.6-rc2 kernel on my Sharp Zaurus C-1000. It 
> hanged almost immediately after uncompressing the kernel. I tracked the
> problem down to a single line in arch/arm/common/sharpsl_param.c:
> 
> memcpy(&sharpsl_param, (void *)PARAM_BASE, sizeof(struct sharpsl_param_info));
> 
> Commenting out the line makes the kernel boot just fine. This left me
> wondering whether sharpsl_param.c is actually needed. Here's a comment
> from sharpsl_param.c that describes what sharpsl_param.c actually does:

Sharp went to the trouble of saving these values into the hardware and
passing them into the drivers. They're basically used by the LCD
initialisation code from what I remember. I don't remember what the
risks are of incorrect values.

>  So sharpsl_save_param() is supposed to fill the sharpsl_param_info struct
>  with various parameters or fill some of the struct fields with -1. 
>  I found only four drivers that use some of these
>  parameters (only two parameters are used by these drivers, comadj and phadadj). 
>  These drivers are:
>  
>  drivers/video/backlight/corgi_lcd.c
>  drivers/video/backlight/locomolcd.c
>  drivers/video/backlight/tosa_bl.c
>  drivers/video/backlight/tosa_lcd.c
>  
>  These drivers also have default values when comadj or phadadj == -1.
>  I checked what values are actually contained in this struct in
>  earlier kernels. 3.2.24 kernel is the latest one i know of where
>  sharpsl_save_param() works properly. And it also has these fields initialised
>  to -1.

What values was it loading from the bootloader? Or are you saying that
it wasn't finding the bootloader information and therefore just using -1
for everything?
 
>  So it seems to me that sharpsl_param.c is redundant as it currently only  
>  serves to assign -1 to a few variables. And drivers that use these variables
>  then handle -1 with assigning default values.

Its not redundant, it sounds like its just broken at some point, at
least on the platform you tested and nobody has noticed/cared. The
better solution would be to fix it. Obviously its much easier to delete
the code though.

Cheers,

Richard

  reply	other threads:[~2012-08-22 19:19 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-08-22 17:27 [RFC][PATCH] Disintegrate sharpsl_param.c dromede at gmail.com
2012-08-22 19:19 ` Richard Purdie [this message]
2012-08-22 21:48   ` Marko Katić
2012-08-24 11:12   ` Pavel Machek
2012-08-24 11:25     ` Cyril Hrubis
2012-08-24 12:53       ` Marko Katić
2012-08-24 12:56         ` Marko Katić
  -- strict thread matches above, loose matches on Subject: below --
2012-08-24 22:24 Stanislav Brabec

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=1345663182.3907.134.camel@ted \
    --to=richard.purdie@linuxfoundation.org \
    --cc=linux-arm-kernel@lists.infradead.org \
    /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;
as well as URLs for NNTP newsgroup(s).