mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Mike Frysinger <vapier.adi@gmail.com>
To: Andrew Morton <akpm@linux-foundation.org>
Cc: linux-fbdev-devel@lists.sourceforge.net,
	linux-kernel@vger.kernel.org, michael.hennerich@analog.com,
	cooloney@kernel.org
Subject: Re: [PATCH v2] fbdev: bfin-lq035q1-fb: new Blackfin Landscape LCD  EZ-Extender driver
Date: Fri, 25 Sep 2009 16:24:10 -0400	[thread overview]
Message-ID: <8bd0f97a0909251324h115c5c47wb2d50cc982ba17dd@mail.gmail.com> (raw)
In-Reply-To: <20090924163240.d03127e3.akpm@linux-foundation.org>

On Thu, Sep 24, 2009 at 19:32, Andrew Morton wrote:
> On Thu, 17 Sep 2009 17:37:06 -0400 Mike Frysinger wrote:
>> +config FB_BFIN_LQ035Q1
>> +     tristate "SHARP LQ035Q1DH02 TFT LCD"
>> +     depends on FB && BLACKFIN
>> +     select FB_CFB_FILLRECT
>> +     select FB_CFB_COPYAREA
>> +     select FB_CFB_IMAGEBLIT
>> +     select BFIN_GPTIMERS
>> +     select SPI
>
> Are we sure about the `select SPI'?  There's only one other place in
> the kernel which does this, and `select' often makes things explode.  I
> fear that you're either selecting the wrong thing or you're selecting
> something which won't work well.

is it there on purpose and is it not just a mistaken typo ?  yes.  do
we really need it and will we cry if it changes to a "depends" ?  no.

it's just confusing to have a device driver disappear if SPI is
disabled, but considering SPI is enabled by default now, it's not a
big deal.

>> +#define DRIVER_NAME "bfin-lq035q1"
>> +static char driver_name[] = DRIVER_NAME;
>
> Will the compielr magically put this string into read-only storage for
> us, or should we do that manually with `const'?

is this question a rhetorical one ?  oh no, infinite loop ...

i'll fix it up in v3

>> +static int lq035q1_control(unsigned char reg, unsigned short value)
>> +{
>> +     int ret;
>> +     u8 regs[3] = {LQ035_INDEX, 0, 0};
>> +     u8 dat[3] = {LQ035_DATA, 0, 0};
>> +
>> +     if (spi_control.spidev) {
>> +             regs[2] = reg;
>> +             dat[1] = value >> 8;
>> +             dat[2] = value & 0xFF;
>> +
>> +             ret = spi_write(spi_control.spidev, regs, ARRAY_SIZE(regs));
>> +             ret |= spi_write(spi_control.spidev, dat, ARRAY_SIZE(dat));
>> +     } else
>> +             return -ENODEV;
>> +
>> +     return ret;
>> +}
>
> I am suspecting that this function (and the similar ones below) rely
> upon state within the hardware and will hence misbehave if two
> instances are run concurrently.
>
> Is that correct>  If so, is there locking to prevent this from occurring?

if by "instances" you mean "users" as in "multiple programs
reading/writing the framebuffer concurrently", then probably.  rather
than handle the locking ourselves, it can be pushed to the SPI bus by
having the regs/dat be transfers in a single message.
-mike

  reply	other threads:[~2009-09-25 20:24 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-09-14 17:49 [PATCH] " Mike Frysinger
2009-09-14 17:49 ` [PATCH] fbdev: bfin-t350mcqb-fb: handle all resources in suspend/resume Mike Frysinger
2009-09-14 17:49 ` [PATCH] fbdev: bfin-t350mcqb-fb: fix LCD dimensions Mike Frysinger
2009-09-17 21:37 ` [PATCH v2] fbdev: bfin-lq035q1-fb: new Blackfin Landscape LCD EZ-Extender driver Mike Frysinger
2009-09-24 23:32   ` Andrew Morton
2009-09-25 20:24     ` Mike Frysinger [this message]
2009-09-25 20:48       ` Mike Frysinger
2009-10-01  5:44 ` [PATCH 1/3 " Mike Frysinger
2009-10-06  6:02   ` [PATCH v4] " Mike Frysinger

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=8bd0f97a0909251324h115c5c47wb2d50cc982ba17dd@mail.gmail.com \
    --to=vapier.adi@gmail.com \
    --cc=akpm@linux-foundation.org \
    --cc=cooloney@kernel.org \
    --cc=linux-fbdev-devel@lists.sourceforge.net \
    --cc=linux-kernel@vger.kernel.org \
    --cc=michael.hennerich@analog.com \
    /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

all inboxes | Powered by JetHome®