Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1756620AbdLVRnn (ORCPT ); Fri, 22 Dec 2017 12:43:43 -0500 Received: from mx0b-00010702.pphosted.com ([148.163.158.57]:57810 "EHLO mx0b-00010702.pphosted.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1756131AbdLVRnl (ORCPT ); Fri, 22 Dec 2017 12:43:41 -0500 X-Greylist: delayed 1940 seconds by postgrey-1.27 at vger.kernel.org; Fri, 22 Dec 2017 12:43:41 EST Date: Fri, 22 Dec 2017 11:11:08 -0600 From: Kyle Roeschley To: Mark Brown Cc: Trent Piepho , "linux-spi@vger.kernel.org" , "linux-kernel@vger.kernel.org" , "geert@linux-m68k.org" Subject: Re: [PATCH] spi: Add a sysfs interface to instantiate devices Message-ID: <20171222171108.GA31574@senary> References: <20171221200309.17967-1-kyle.roeschley@ni.com> <1513890342.26695.4.camel@impinj.com> <20171222155603.GM1827@finisterre> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20171222155603.GM1827@finisterre> User-Agent: Mutt/1.9.1 (2017-09-22) X-Originating-IP: [130.164.62.227] X-ClientProxiedBy: CY4PR1801CA0017.namprd18.prod.outlook.com (10.171.252.30) To CY1PR04MB2282.namprd04.prod.outlook.com (10.167.9.9) X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 1072e7a2-102f-49c2-f18b-08d5495f00ef X-Microsoft-Antispam: UriScan:;BCL:0;PCL:0;RULEID:(4534020)(4602075)(4627115)(201703031133081)(201702281549075)(5600026)(4604075)(2017052603307)(7153060);SRVR:CY1PR04MB2282; X-Microsoft-Exchange-Diagnostics: 1;CY1PR04MB2282;3:hACM1EiIFNTCB3p5gnDUSGIkD8GTpZOIDx68MXi5FYE8POuHmd+fXPi9Bvlm7+b+DGW0sdfnxB0QsIPHvPTDB/RrjuOKXDzItLF+m8ErIR3t2rFQHKCJKi6iEj0FgvRAsar+eX4z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ZMJu8s9mEK2+1II15vE9zI9yOQySXw2TpcIzAOMOwON6d0m4vxiaHpOyaEzDarr+lDEgZ+KNJrnz+SwC+is0y+Y0IY5CHIMwJ9Sel5LdbMPcd+ot+UlHsy5HDm8FMLQ+NojHM6BuPu6J1bymaoySPf2MTbICN0EO4403l4kl3gnzWsl0l3NcQuls2cu/2BA0XXJFrn4NGbnN4wsviC4M7Er+pIKtR3czP59ZLOW0dUyJE+i7Vfmhj3eDkHSrp9DIRvOXg+HhOkhlx+LWA8yyQamLd0EVMmONt+0MMatJZFsluHe5iMH+3Vom1dcZxNifo4jaDJk=;4:AUzk/U3bXdog+RMRftLLGjmoUc4F1Cie04lCZPdCylZTzzXyAsSdszeV7tvcWRVUOKS6iUBN6wnk2UxNDfbm87uZ3wsghX4kYhf6cCmzxFD9BItT03iUoSdm7I4khdmh3Q/xadPQhRc9fjUTWiNXHAEAlRr7Nu7RZwyVerkuRzpkT+5VbhsThNAJH6G8PnwJloOE1S3WbCaAp7QmXhVFz/bedjA8YCPUrrKSAyPouSvmxDFGJfFOO4pl9LwpMck/8/aGPBmjUrhsgWAB6enb5w== X-Microsoft-Antispam-PRVS: X-Exchange-Antispam-Report-Test: UriScan:; X-Exchange-Antispam-Report-CFA-Test: BCL:0;PCL:0;RULEID:(6040470)(2401047)(5005006)(8121501046)(10201501046)(3231023)(944501045)(93006095)(93001095)(3002001)(6041268)(20161123558120)(20161123562045)(20161123564045)(201703131423095)(201702281528075)(20161123555045)(201703061421075)(201703061406153)(20161123560045)(6072148)(201708071742011);SRVR:CY1PR04MB2282;BCL:0;PCL:0;RULEID:(100000803101)(100110400095);SRVR:CY1PR04MB2282; X-Forefront-PRVS: 05299D545B X-Forefront-Antispam-Report: SFV:NSPM;SFS:(10019020)(366004)(346002)(39860400002)(376002)(39380400002)(396003)(377424004)(199004)(24454002)(189003)(33896004)(6116002)(50466002)(6306002)(23726003)(386003)(106356001)(105586002)(33656002)(59450400001)(3846002)(478600001)(305945005)(966005)(86362001)(76176011)(7736002)(9686003)(52116002)(229853002)(2906002)(4001150100001)(6246003)(55016002)(33716001)(97736004)(16526018)(1076002)(6496006)(8666007)(83506002)(54906003)(6916009)(8936002)(2950100002)(81156014)(4326008)(68736007)(81166006)(25786009)(8676002)(5660300001)(53936002)(16586007)(316002)(58126008)(47776003)(66066001)(6666003)(18370500001)(6606295002);DIR:OUT;SFP:1102;SCL:1;SRVR:CY1PR04MB2282;H:senary;FPR:;SPF:None;PTR:InfoNoRecords;A:1;MX:1;LANG:en; X-Microsoft-Exchange-Diagnostics: =?us-ascii?Q?1;CY1PR04MB2282;23:WfuS/fR4BABcB1ZgGRgkL4kbZOsDRahn79X0WjOxC?= =?us-ascii?Q?DpwMWbHYctw+7nVtRNOdkw7254iz9UWBwckoL4TClUVB/MuEIecy7h6SC20H?= =?us-ascii?Q?0RELXQZtXHr5KKRVhoMWsnPKPXY7mPxGRq0WcWXKlN+P0F+jkOm7opHQgWdy?= =?us-ascii?Q?A/uNXhRzjPXJe4/LMBhf06lOt/c+oa7GS2EaYK+1SSgu+xF+REEewYW3CiHQ?= =?us-ascii?Q?tifEGX7oQrcEla0okhmusmKR/3Ysdau43dqUYnB3hSKl3fEvp67MbCP4n9dM?= =?us-ascii?Q?y0sdY1tVv6yuRqHm+vsfxj1nC+ELBVX+Kq72XfZUIu09LYQaY8AHdUm7uLzR?= =?us-ascii?Q?wydPHuvGrPpX7M/CblDqD7/na4aKip3b3n4or+o08gGWuud1A4oUUULDdW/8?= =?us-ascii?Q?iCCHd3JT7I9hrqfOV/M0L526hkXBKlWehSjW0sTvsYNivmVAqzUWvHSw6+qR?= =?us-ascii?Q?7UoZ4raoQeRvuZfc/FMKTmaZUkTQLe4YQFWIh5ZnA3r8zKboPVHUIc8b0cAd?= =?us-ascii?Q?ghQgqVMW0x25106cWKhdqSZdb50U+QsqU4zMhUBnvex6lsDUTs0R0Mk00Vxt?= =?us-ascii?Q?C0QwpOQNq9Yy8LxjphB1aJbeauZIL9jdjNmJMMd+9xaUrdDwfWLtqZXHXToy?= =?us-ascii?Q?zwlwqZC2xJIWueFRo9scsEsKXXFhkz9nzuAV5f0qWFdEMzQop27TSEIfGzZP?= =?us-ascii?Q?3cFXV4ex68GmAngYJC8ZMQQye9OZQnUC570z6k6i/jifT50UNlyLt7Kj6Djg?= =?us-ascii?Q?EHtVTCGW7N1texiqnqVMVON99WXSa3aYYQJMT/6gUPz+d1RlnuzuEw/fx5P8?= =?us-ascii?Q?Sfr3kzifGQhJUrhGrSfKisRO2kXng4pwab9jqHs3I3rT8MCsAFRus17Te+/I?= =?us-ascii?Q?3G+Zc5ZBbT171pCtKB753Fukulh8d5Dai49DXU9iKMbhqyAAhJds1Kv2Iboz?= =?us-ascii?Q?XX3kwxxsIIHMzq2XCdHzSI/iI+ZyHEiWT8x5iZh3Da3qfOKpbLQ8Q1uOZlQ5?= =?us-ascii?Q?3jVud6t2028/s9g2CHrJWp1AJBBRXJjE6ENjDcH6hVT3/anrJRgUeBdKzNJ3?= =?us-ascii?Q?8wQo2RZf3WF+BaCUrQYW56Lee7nVxvq1spJTvPXkiAMCe8NgyjG02nqPV/b2?= =?us-ascii?Q?4i865A/QKjQjMzxWfX/C8ip7YN/CRCe3Ab37QKCXsHIoZY6CTsZp5qGWG3nG?= =?us-ascii?Q?UXyfqPgiFuizxaazTSTAmQBsNIBh02eTT4o3d96UhfEwKEADFnDumezEh3s9?= =?us-ascii?Q?OFyQiHxv4873aBwJbiobZ1NaexzLnb5FWkJFfseV8OFq5qrjV/GHTI+VCnqC?= =?us-ascii?Q?MRRppP23nCYZm1rVU3JRURTep8s9uIchhKN4U/BHJCWzBfp4do21zxZzQTGR?= =?us-ascii?Q?ko4eO2b+sOK3ISl3HXfaIA4PYfpKfvxf+zTsNsvZ332N1O4?= X-Microsoft-Exchange-Diagnostics: 1;CY1PR04MB2282;6:Cu4BqtotAzVqpvdbXZptSaU3ndGIqEC7881m9+oZVlGYFar2AZT8TaiqkfPg0N59CdMKQW22EXVRE9Rz5gYB2cdp+R1792H3/ZzmTxsy1FAKnr9GHtYSlNCQWNvhV28YZhd47MjqQWAyvcbx0nzZMlOq/hzJ1FQskA2LRt8dhN5owtiOCl+cQs1UvOFPYMGthLjB1+qTf57QWXtCnWXMQP+ZVVeoVPm3WmeLQC9T2XMSlYhX2PfhyZ0QpHKR6aBitdmaqpp/1mv/JxC1/bkFce6uogBWLcklTk08uud5a0gQQYXXbTDglgcmxAjzIsP6fFN/N1A/mbR9IuU+EF0Ykxx1n1141+evg7Y6PYm88Cc=;5:7Ky4pbzaXhBS3dxjlWGeA9qJpL264IXiFum+20PC+gN+SF46N2t547hmht+lzi0pU/dnITPgVS/SiXSTXnfLSCQ8dKG8UjCg1XPTNl6+NVRcbF7LSmh+N+7TOhRFJnW0VdRYm26vKm+mTrv2tqZn1UXH6Im6lZ1z7z+4UDk5vIU=;24:qpZmH1gx1oAEoiAkt6ABbqURDj13qYcwKkdGbBMrbCERQKAZXfvEcr5E/eip28DKqO87qRhlPpip4B3oXhVh0QByIj0xwJWCp3Dx/56P46U=;7:zYgQZ5agtbKV2R5so4F+z2YlBLR61D3CFTMn/Ptv9VGUOHc4KS8x2yHVe6w8iGCyRzPUv2HAWwC1p97QSOzqYOOt3j/04IwAlilYZtCjgXgXHjAytInHEerZbwICECERZmoHej9fR8quge5D2TA5o34Vb790sF2Wa0CyKdVHz7/qWiBQIBCwPz/NBKyqsOJrPWcerWJa4MEviBVnPQN8SrsRY0nT91/FTzRsXCg6Bybe3wu1tJJgZOg5PGGAeK5M SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-OriginatorOrg: ni.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 22 Dec 2017 17:11:12.6738 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 1072e7a2-102f-49c2-f18b-08d5495f00ef X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 87ba1f9a-44cd-43a6-b008-6fdb45a5204e X-MS-Exchange-Transport-CrossTenantHeadersStamped: CY1PR04MB2282 X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10432:,, definitions=2017-12-22_06:,, signatures=0 X-Proofpoint-Spam-Details: rule=inbound_policy_notspam policy=inbound_policy score=30 priorityscore=1501 malwarescore=0 suspectscore=3 phishscore=0 bulkscore=0 spamscore=0 clxscore=1011 lowpriorityscore=0 mlxscore=0 impostorscore=0 mlxlogscore=999 adultscore=0 classifier=spam adjust=30 reason=mlx scancount=1 engine=8.0.1-1711220000 definitions=main-1712220242 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1776 Lines: 46 On Fri, Dec 22, 2017 at 03:56:03PM +0000, Mark Brown wrote: > On Thu, Dec 21, 2017 at 09:05:43PM +0000, Trent Piepho wrote: > > On Thu, 2017-12-21 at 14:03 -0600, Kyle Roeschley wrote: > > > Add a sysfs interface to instantiate and delete SPI devices using the > > > spidev driver. This can be used when developing a driver on a > > > self-soldered board which doesn't yet have proper SPI device declaration > > > at the platform level, and presumably for various debugging situations. > > > > Inspired by 99cd8e25875a ("i2c: Add a sysfs interface to instantiate > > > devices"). > > > The i2c interface allows one to specify the type of device to create. > > Why must this interface be linked to spidev and only capable of > > creating spidev devices? > > Right, that doesn't seem good. I also can't see anything in the actual > code which suggests that this is tied to spidev except the log messages. > Quoting Geert's email [1] on the subject: > To me, the above sounds a bit contradictive: either you have > 1. a simple (trivial) description, which can be handled by spidev and > userspace, and thus by just writing " spidev" to a new_device > sysfs node, or > 2. a complex description, for which you need a specialized in-kernel driver, > so you're gonna need a real DT node (and overlays?) to describe it. > > I don't think writing a complex description to a new_device sysfs node makes > sense. And regarding not being linked to spidev, see modalias in new_device_store: > > > + struct spi_board_info bi = { > > > + .modalias = "spidev", > > > + .max_speed_hz = ctlr->max_speed_hz, > > > + }; [1] https://marc.info/?l=linux-spi&m=151199390921251&w=2 Happy holidays, -- Kyle Roeschley Software Engineer National Instruments