Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753521AbdGXLHd (ORCPT ); Mon, 24 Jul 2017 07:07:33 -0400 Received: from mout.web.de ([212.227.15.3]:51133 "EHLO mout.web.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751539AbdGXLHX (ORCPT ); Mon, 24 Jul 2017 07:07:23 -0400 Subject: Re: [PATCH] spi: pxa2xx: Only claim CS GPIOs when the slave device is created To: Andy Shevchenko Cc: Daniel Mack , Haojian Zhuang , Robert Jarzmik , Mark Brown , linux-spi , Linux Kernel Mailing List , linux-arm-kernel References: <90b3e14d-0077-9a25-9d90-ab340577af57@web.de> <59066818-a284-4da0-d05f-d2503aeee44b@web.de> From: Jan Kiszka Message-ID: Date: Mon, 24 Jul 2017 13:06:43 +0200 User-Agent: Mozilla/5.0 (X11; U; Linux i686 (x86_64); de; rv:1.8.1.12) Gecko/20080226 SUSE/2.0.0.12-1.1 Thunderbird/2.0.0.12 Mnenhy/0.7.5.666 MIME-Version: 1.0 In-Reply-To: Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="G5EAo9QTxabKQQ46iBoIp7Wxg41iDEvk9" X-Provags-ID: V03:K0:1T5REM3zHlDFAFllPeRea3VrBWgbJkvYDpoA4koPo+RsAdvrdYu IJ590Qufc265wsnA07jW8Kg5qwDR11f4tliH1Kol3GXmV8hhEWno0+ZALVnTVtj4+AUxlEr osZTzsHUYdXZ4r8lNNp7iWCneRRf4ncov+4ICTzbCrpSpBVF2vcbw9aMRyUbtGhKo1vMe96 PN+TbvWPxg6hdsgxBq9Bw== X-UI-Out-Filterresults: notjunk:1;V01:K0:w2M8qz64R+o=:sAfQCHzW7aCetiQgsfzRHM kNoNYdzbTU0Jorbdqcn3w8K31albapYpOf/iGi8vI549MjL/56ZG14E+DL17SNBDGdiIK00Yk lqdJO+8xErRKsvjPfilMoDAGfkML08bjH8TfRDcLXt71dD4DaUCEti7Rl+q5CH+5T71lU5Hif nQhcUpJspQUJG6jrSmN0vrWCCxMC83mZRlhyYQMQMN179HtgqPY4avK58zR77mdmGJBjGQWIT 7teB1eVMPzoXtR91KJICW3PyAF/5albEPRp1ZNDmlhjx0nBW+d8gFAmP3kSoa6x0a8XaxE9vo C0hCfHtMb9c1urQG38+4ZcG695In7DQViDRkd/ApFE11ytLE+LgnUU5fLelgGkBl0M5/zXUFq Ychol1y+6E2971jMzXNQyA0OsGYiuJVIpr0j99CVM5F63eAm/8FtrmUIK2uIy2Bmzo8EUmv3G ShsEhoqKPGvsn56KNIUbSBN5GtWC0aG9dM546r/YQ5BfCKfPreU98E+28z1Z5f9XO6JJjOw7a CpC33LpZZV1EzpnRHPgkFB2K3Fm9aqO3bSWH8sxs3zFnVU25QkK8C83xtrx1gqYhAWQKHBWSp AtcSTXkIohLRC2qcYpNHWUZrhYRo9mexneHU8XxR2evaABV1xdQ2T4ZbHIMUnvlOqeQTxGANK QQIkhz4tF8mfqBkc+Qk0zusk4M2iMKCzgRSvEjIhFPbZBqoG+l5h7KDU0HKUq8rQZdZElEf19 LFHWvnj1q/x7fDehfkQ7hODBpkyjp9+zaknCSZrsp/RyaNju7VlOX82RlBFmdpQ1Cd42tRJi2 jtmmkTRnyodpE0n/K2VquP6rxr0Qw== Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 3479 Lines: 101 This is an OpenPGP/MIME signed message (RFC 4880 and 3156) --G5EAo9QTxabKQQ46iBoIp7Wxg41iDEvk9 Content-Type: multipart/mixed; boundary="rJwSAsX6NAvx0JlWnpgO2jcTGtb0PwtPF"; protected-headers="v1" From: Jan Kiszka To: Andy Shevchenko Cc: Daniel Mack , Haojian Zhuang , Robert Jarzmik , Mark Brown , linux-spi , Linux Kernel Mailing List , linux-arm-kernel Message-ID: Subject: Re: [PATCH] spi: pxa2xx: Only claim CS GPIOs when the slave device is created References: <90b3e14d-0077-9a25-9d90-ab340577af57@web.de> <59066818-a284-4da0-d05f-d2503aeee44b@web.de> In-Reply-To: --rJwSAsX6NAvx0JlWnpgO2jcTGtb0PwtPF Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: quoted-printable On 2017-07-24 13:02, Andy Shevchenko wrote: > On Mon, Jul 24, 2017 at 1:53 PM, Jan Kiszka wrote: >> On 2017-07-24 12:44, Andy Shevchenko wrote: >>> +Cc: Mika >>> >>> On Sat, Jul 8, 2017 at 11:41 AM, Jan Kiszka wrote= : >>>> From: Jan Kiszka >>>> >>>> Avoid hogging chip select GPIOs just because they are listed for the= >>>> master. They might be mulitplexed and, if no slave device is attache= d, >>>> used for different purposes. Moreover, this strategy avoids having t= o >>>> allocate a cs_gpiods structure. >>>> >>>> Tested on the IOT2000 where the second SPI bus is connected to an >>>> Arduino-compatible connector and multiplexed between SPI, GPIO and P= WM >>>> usage. >=20 >>> This breaks all systems which are using _DSD. >> >> Err, can you elaborate? Worked fine here with _DSD on the IOT2000. >=20 > Sure, the setup() function can be called several times for the same > chip (as written in the comment inside the function). > Definitely your code doesn't follow this, since gpiod_get_index() is > returning -EBUSY when called 2+ time, that's what I got on all my > tests. Ah, multiple devices on the same controller - I only had one. >=20 >>> While I'm looking for fix, I get feeling that the approach itself is = not right, >>> >>> So, for now I would vote for immediate revert and then rethink what w= e >>> can do here. >> >> I'm fine with reverting because the patch wasn't clean anyway (mixed o= ld >> and new GPIO API) - aside from whatever you found in addition. >=20 >> I had an >> update pending but, as you are looking into this anyway, I'm sure your= >> patches will be more holistic. >=20 > Please, send it as RFC, because it might have something we can use/re-u= se. >=20 OK, will dig them out later. Jan --rJwSAsX6NAvx0JlWnpgO2jcTGtb0PwtPF-- --G5EAo9QTxabKQQ46iBoIp7Wxg41iDEvk9 Content-Type: application/pgp-signature; name="signature.asc" Content-Description: OpenPGP digital signature Content-Disposition: attachment; filename="signature.asc" -----BEGIN PGP SIGNATURE----- Version: GnuPG v2 iEYEARECAAYFAll11MoACgkQitSsb3rl5xTRpACgrZyIDcG/tVbIgou80/1B99Hk CUoAn3coiep485jY8nWqtxZAvt+LlP8H =IwQR -----END PGP SIGNATURE----- --G5EAo9QTxabKQQ46iBoIp7Wxg41iDEvk9--