From: Maxime Ripard <maxime.ripard-wi1+55ScJUtKEb57/3fJTNBPR1lH4CV8@public.gmane.org>
To: Michal Suchanek <hramrach-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
Cc: Mark Brown <broonie-DgEjT+Ai2ygdnm+yROfE0A@public.gmane.org>,
Greg Kroah-Hartman
<gregkh-hQyY1W1yCW8ekmWlsbkhG0B+6BGkLq7r@public.gmane.org>,
linux-kernel-u79uwXL29TY76Z2rM5mHXA@public.gmane.org,
Hans de Goede <hdegoede-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org>,
linux-spi-u79uwXL29TY76Z2rM5mHXA@public.gmane.org,
Martin Sperl <kernel-TqfNSX0MhmxHKSADF0wUEw@public.gmane.org>
Subject: Re: [PATCH] spi: Add option to bind spidev to all chipselects
Date: Wed, 13 May 2015 12:16:25 +0200 [thread overview]
Message-ID: <20150513101625.GY10961@lukather> (raw)
In-Reply-To: <20150513093441.80359.qmail-ve7rdfgbAvJ3WEpVTuSGmqVXKuFTiq87@public.gmane.org>
[-- Attachment #1: Type: text/plain, Size: 1575 bytes --]
Hi,
On Wed, May 13, 2015 at 09:34:41AM -0000, Michal Suchanek wrote:
> Bypass the check if CS is in use for spidev devices if CONFIG_SPIDEV_SHADOW is
> set. Rename spidev devices to avoid sysfs conflict.
>
> This allows dynamically loading SPI device overlays or communicating
> with SPI devices configured by a kernel driver from userspace.
>
> Signed-off-by: Michal Suchanek <hramrach-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
Output from checkpatch:
total: 2 errors, 4 warnings, 4 checks, 157 lines checked
...
I told you a few times already to run checkpatch before sending your
patches, apparently you make a point at ignoring me. Fine.
That being said, I'm not sure this is the right approach, or at least,
it doesn't solve anything. If SPIDEV_SHADOW is not set, you will still
have the same issue with addition of new devices on previously unused
chip selects, and where we have an spidev device now.
What I think we should do is, when a new device is created, we just
lookup the modalias of the spi_device associated to it.
If that modalias is "spidev", then unregister the spidev device,
register the new device, you're done. If not, return an error.
On the SPIDEV_SHADOW stuff itself, I'm not sure this is such a good
idea. There's a good chance it will break the driver by doing stuff
behind its back, possibly in a way that will harm the whole kernel,
and it's something we usually try to avoid.
Maxime
--
Maxime Ripard, Free Electrons
Embedded Linux, Kernel and Android engineering
http://free-electrons.com
[-- Attachment #2: Digital signature --]
[-- Type: application/pgp-signature, Size: 819 bytes --]
WARNING: multiple messages have this Message-ID (diff)
From: Maxime Ripard <maxime.ripard@free-electrons.com>
To: Michal Suchanek <hramrach@gmail.com>
Cc: Mark Brown <broonie@kernel.org>,
Greg Kroah-Hartman <gregkh@linuxfoundation.org>,
linux-kernel@vger.kernel.org, Hans de Goede <hdegoede@redhat.com>,
linux-spi@vger.kernel.org, Martin Sperl <kernel@martin.sperl.org>
Subject: Re: [PATCH] spi: Add option to bind spidev to all chipselects
Date: Wed, 13 May 2015 12:16:25 +0200 [thread overview]
Message-ID: <20150513101625.GY10961@lukather> (raw)
In-Reply-To: <20150513093441.80359.qmail@dec59.ruk.cuni.cz>
[-- Attachment #1: Type: text/plain, Size: 1545 bytes --]
Hi,
On Wed, May 13, 2015 at 09:34:41AM -0000, Michal Suchanek wrote:
> Bypass the check if CS is in use for spidev devices if CONFIG_SPIDEV_SHADOW is
> set. Rename spidev devices to avoid sysfs conflict.
>
> This allows dynamically loading SPI device overlays or communicating
> with SPI devices configured by a kernel driver from userspace.
>
> Signed-off-by: Michal Suchanek <hramrach@gmail.com>
Output from checkpatch:
total: 2 errors, 4 warnings, 4 checks, 157 lines checked
...
I told you a few times already to run checkpatch before sending your
patches, apparently you make a point at ignoring me. Fine.
That being said, I'm not sure this is the right approach, or at least,
it doesn't solve anything. If SPIDEV_SHADOW is not set, you will still
have the same issue with addition of new devices on previously unused
chip selects, and where we have an spidev device now.
What I think we should do is, when a new device is created, we just
lookup the modalias of the spi_device associated to it.
If that modalias is "spidev", then unregister the spidev device,
register the new device, you're done. If not, return an error.
On the SPIDEV_SHADOW stuff itself, I'm not sure this is such a good
idea. There's a good chance it will break the driver by doing stuff
behind its back, possibly in a way that will harm the whole kernel,
and it's something we usually try to avoid.
Maxime
--
Maxime Ripard, Free Electrons
Embedded Linux, Kernel and Android engineering
http://free-electrons.com
[-- Attachment #2: Digital signature --]
[-- Type: application/pgp-signature, Size: 819 bytes --]
next prev parent reply other threads:[~2015-05-13 10:16 UTC|newest]
Thread overview: 62+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-05-12 20:33 [PATCH] spi: Force the registration of the spidev devices Maxime Ripard
2015-05-12 20:33 ` Maxime Ripard
[not found] ` <1431462804-30467-1-git-send-email-maxime.ripard-wi1+55ScJUtKEb57/3fJTNBPR1lH4CV8@public.gmane.org>
2015-05-13 9:34 ` [PATCH] spi: Add option to bind spidev to all chipselects Michal Suchanek
2015-05-13 9:34 ` Michal Suchanek
[not found] ` <20150513093441.80359.qmail-ve7rdfgbAvJ3WEpVTuSGmqVXKuFTiq87@public.gmane.org>
2015-05-13 10:16 ` Maxime Ripard [this message]
2015-05-13 10:16 ` Maxime Ripard
2015-05-13 10:40 ` Michal Suchanek
2015-05-13 10:40 ` Michal Suchanek
2015-05-13 11:05 ` Mark Brown
2015-05-13 11:05 ` Mark Brown
2015-05-13 11:26 ` [PATCH] spi: Force the registration of the spidev devices Mark Brown
2015-05-13 11:26 ` Mark Brown
[not found] ` <20150513112604.GI3066-GFdadSzt00ze9xe1eoZjHA@public.gmane.org>
2015-05-13 12:35 ` Michal Suchanek
2015-05-13 12:35 ` Michal Suchanek
2015-05-13 12:51 ` Maxime Ripard
2015-05-13 12:51 ` Maxime Ripard
2015-05-13 14:36 ` Mark Brown
2015-05-13 14:36 ` Mark Brown
[not found] ` <20150513143610.GT2761-GFdadSzt00ze9xe1eoZjHA@public.gmane.org>
2015-05-13 15:31 ` Michal Suchanek
2015-05-13 15:31 ` Michal Suchanek
[not found] ` <CAOMqctTd7xG6mwX9AojTH4uaGDY06xOgDFUP437VDiE0rp0sXA-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2015-05-13 17:43 ` Mark Brown
2015-05-13 17:43 ` Mark Brown
2015-05-13 19:09 ` Maxime Ripard
2015-05-13 19:10 ` Geert Uytterhoeven
2015-05-13 19:10 ` Geert Uytterhoeven
[not found] ` <CAMuHMdWJ730G_a6=vQgs4gV837am5KKd7zEhU2FaHw2cpv=aRA-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2015-05-13 19:41 ` Maxime Ripard
2015-05-13 19:41 ` Maxime Ripard
2015-05-13 15:37 ` Greg Kroah-Hartman
2015-05-13 15:37 ` Greg Kroah-Hartman
[not found] ` <20150513153740.GC11677-U8xfFu+wG4EAvxtiuMwx3w@public.gmane.org>
2015-05-13 15:52 ` Michal Suchanek
2015-05-13 15:52 ` Michal Suchanek
2015-05-13 17:13 ` Mark Brown
2015-05-13 17:13 ` Mark Brown
[not found] ` <20150513171300.GD2761-GFdadSzt00ze9xe1eoZjHA@public.gmane.org>
2015-05-13 17:20 ` Greg Kroah-Hartman
2015-05-13 17:20 ` Greg Kroah-Hartman
[not found] ` <20150513172028.GA18303-U8xfFu+wG4EAvxtiuMwx3w@public.gmane.org>
2015-05-13 17:39 ` Mark Brown
2015-05-13 17:39 ` Mark Brown
[not found] ` <20150513173922.GF2761-GFdadSzt00ze9xe1eoZjHA@public.gmane.org>
2015-05-13 18:16 ` Greg Kroah-Hartman
2015-05-13 18:16 ` Greg Kroah-Hartman
2015-05-13 18:32 ` Mark Brown
[not found] ` <20150513183211.GK2761-GFdadSzt00ze9xe1eoZjHA@public.gmane.org>
2015-05-13 18:36 ` Greg Kroah-Hartman
2015-05-13 18:36 ` Greg Kroah-Hartman
[not found] ` <20150513183653.GA879-U8xfFu+wG4EAvxtiuMwx3w@public.gmane.org>
2015-05-13 18:51 ` Mark Brown
2015-05-13 18:51 ` Mark Brown
[not found] ` <20150513185149.GL2761-GFdadSzt00ze9xe1eoZjHA@public.gmane.org>
2015-05-13 19:17 ` Maxime Ripard
2015-05-13 19:17 ` Maxime Ripard
2015-05-13 17:50 ` Maxime Ripard
2015-05-13 17:50 ` Maxime Ripard
2015-05-13 18:12 ` Mark Brown
2015-05-13 18:17 ` Greg Kroah-Hartman
2015-05-13 18:17 ` Greg Kroah-Hartman
[not found] ` <20150513181736.GC16811-U8xfFu+wG4EAvxtiuMwx3w@public.gmane.org>
2015-05-13 19:23 ` Geert Uytterhoeven
2015-05-13 19:23 ` Geert Uytterhoeven
2015-05-13 19:26 ` Maxime Ripard
2015-05-13 19:26 ` Maxime Ripard
2015-05-13 22:33 ` Greg Kroah-Hartman
2015-05-13 22:33 ` Greg Kroah-Hartman
2015-05-15 8:09 ` Maxime Ripard
[not found] ` <20150513223331.GA26748-U8xfFu+wG4EAvxtiuMwx3w@public.gmane.org>
2015-05-14 14:34 ` Mark Brown
2015-05-14 14:34 ` Mark Brown
2015-07-15 6:27 ` Lucas De Marchi
2015-07-15 6:27 ` Lucas De Marchi
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=20150513101625.GY10961@lukather \
--to=maxime.ripard-wi1+55scjutkeb57/3fjtnbpr1lh4cv8@public.gmane.org \
--cc=broonie-DgEjT+Ai2ygdnm+yROfE0A@public.gmane.org \
--cc=gregkh-hQyY1W1yCW8ekmWlsbkhG0B+6BGkLq7r@public.gmane.org \
--cc=hdegoede-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org \
--cc=hramrach-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org \
--cc=kernel-TqfNSX0MhmxHKSADF0wUEw@public.gmane.org \
--cc=linux-kernel-u79uwXL29TY76Z2rM5mHXA@public.gmane.org \
--cc=linux-spi-u79uwXL29TY76Z2rM5mHXA@public.gmane.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.