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:48:27 -0400 [thread overview]
Message-ID: <8bd0f97a0909251348k9e5240av6ebd49d2e99c04a1@mail.gmail.com> (raw)
In-Reply-To: <8bd0f97a0909251324h115c5c47wb2d50cc982ba17dd@mail.gmail.com>
On Fri, Sep 25, 2009 at 16:24, Mike Frysinger wrote:
> On Thu, Sep 24, 2009 at 19:32, Andrew Morton wrote:
>> On Thu, 17 Sep 2009 17:37:06 -0400 Mike Frysinger wrote:
>>> +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.
hmm there shouldnt be any locking problems here actually. the spi
access is only to initialize/shutdown, and there is a dedicated CS for
each device. so i dont think anything here really needs changing
(other than to allocate the spi_control global variable dynamically in
the probe).
-mike
next prev parent reply other threads:[~2009-09-25 20:48 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
2009-09-25 20:48 ` Mike Frysinger [this message]
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=8bd0f97a0909251348k9e5240av6ebd49d2e99c04a1@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®