From owner-freebsd-mips@freebsd.org Fri May 20 06:35:18 2016 Return-Path: Delivered-To: freebsd-mips@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id CE6ACB382C9; Fri, 20 May 2016 06:35:18 +0000 (UTC) (envelope-from adrian.chadd@gmail.com) Received: from mail-io0-x236.google.com (mail-io0-x236.google.com [IPv6:2607:f8b0:4001:c06::236]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 958B21230; Fri, 20 May 2016 06:35:18 +0000 (UTC) (envelope-from adrian.chadd@gmail.com) Received: by mail-io0-x236.google.com with SMTP id f8so2957148ioe.3; Thu, 19 May 2016 23:35:18 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:sender:in-reply-to:references:date:message-id:subject :from:to; bh=QUZu+YFpfXkDCHEBjBDQ7BXJ8gQJ2XgdOGKEW2YYWaM=; b=tzHvXLouwfiWQbiXFE1bQIe8YNI7LxRC+re3PBgyLtVYxSFLcSEqqO4UcAmUNCx8/4 p/oOBwS/Ldpn4uPKAj6p2/Hmn0OXXTlDOCebPAm6DQtOa7qFrd5u2WJt5FVDRzdEWZRa EybtscvolfjOlLsq7YZSQQZTu7quP+g1CmVX+NWTO+1EE7Bh9t89eoXMR2SIGS5ME7oq jGcnUTEu3zGO/FR36Z4dhKgSwy3nJWBdM9XwIJ5fNCZIxWF7IvhLgXu2syH9kUauq5PL oFZmKnpKENwM5DdAv+CK9xP0nLz9xZgdkY85TpVxQedEJv68/At7bEDs+65N1KTRKKq0 HAmw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:sender:in-reply-to:references:date :message-id:subject:from:to; bh=QUZu+YFpfXkDCHEBjBDQ7BXJ8gQJ2XgdOGKEW2YYWaM=; b=gEtG2b3+tKJIpELFnDf7s/FCNI7w58jEhWeNJIUcIMM296oPU40ByHshL3G7XBwufb wPWW7vkvuhNtw4+KzCcHfUnMLaRUQrHcCWAl7mbyINYPYC2tJeQMIVSqLL3Mrg2h600B H79d6BQXwW7s+C1E6Wgv07DCBn5swskuQF7bmJKyyHm0e4tONAAjPWfjBPuos1XCwr/V 4QjqooVnLd2oRAF4dcJExiWxjCF9zsrbdD/CnlVWB/61cdliQv+Bdqu8mN4D1U/CXBFM ZQg86QCwCFPNpvs56hsqExjsn1QzN4YErG1SbH76Oel4MXXabk27e/IXBOCwRYpGmmmv 8d0A== X-Gm-Message-State: AOPr4FViIloKoo5ZaI7hcyEDnp2Dg56PkQkYRO0SlCiYl21TnnkPQj5rIDjr5DHtdzdJoojsccpQ7+IVtR5A0Q== MIME-Version: 1.0 X-Received: by 10.36.83.65 with SMTP id n62mr1335985itb.71.1463726117831; Thu, 19 May 2016 23:35:17 -0700 (PDT) Sender: adrian.chadd@gmail.com Received: by 10.36.113.3 with HTTP; Thu, 19 May 2016 23:35:17 -0700 (PDT) In-Reply-To: References: <201604191539.u3JFdkHx048678@repo.freebsd.org> <20160419171243.GA30453@bsdpad.com> <1461097280.1232.34.camel@freebsd.org> Date: Thu, 19 May 2016 23:35:17 -0700 X-Google-Sender-Auth: j4CkV0I6RpGibSIf7DOWY7et3-M Message-ID: Subject: Re: svn commit: r298274 - head/sys/dev/spibus From: Adrian Chadd To: Patrick Kelsey , "freebsd-mips@freebsd.org" , "freebsd-arm@freebsd.org" , Ruslan Bukin Content-Type: text/plain; charset=UTF-8 X-BeenThere: freebsd-mips@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: Porting FreeBSD to MIPS List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 20 May 2016 06:35:18 -0000 I've reviewed the patches from luiz, and these look fine. but indeed, this patchset does set/release the bus each transaction so we can do multiple transactions whilst holding the bus. Which is fine, but it means I have to undo ruslan's removal in the below commit. I'm happy to run through and do each of the spi bus drivers (as there are more now than the two you patched) but it's a bit close to the 11.0-release cycle to go and churn the spibus code. But, if people think it's worth doing it so we can try to get mmcspi into the tree before 11.0-rel is cut, I'm happy to run through and do it. I actually have some AR9331 stuff now that could use mmcspi. :) What do people think? -adrian On 19 April 2016 at 14:19, Patrick Kelsey wrote: > > > On Tue, Apr 19, 2016 at 4:41 PM, Patrick Kelsey wrote: >> >> >> >> >> On Tue, Apr 19, 2016 at 4:38 PM, Adrian Chadd >> wrote: >>> >>> On 19 April 2016 at 13:37, Patrick Kelsey wrote: >>> > >>> > >>> > On Tue, Apr 19, 2016 at 4:21 PM, Ian Lepore wrote: >>> >> >>> >> On Tue, 2016-04-19 at 13:17 -0700, Juli Mallett wrote: >>> >> > Patrick Kelsey offered an mmcspi driver for FreeBSD, but nobody >>> >> > seemed >>> >> > interested. I know of one proprietary branch of FreeBSD using it. >>> >> > You might poke him if you want to know how he dealt with this, and >>> >> > if >>> >> > you want to commit his driver. >>> >> > >>> >> >>> >> Patrick is a committer, maybe he should just commit it. :) >>> > >>> > >>> > What I believe originally held up that driver being committed (by >>> > others - >>> > this was before my commit bit) was that I relied on some out-of-tree >>> > spibus >>> > changes Luiz had made (as I recall, mainly being able to reserve the >>> > SPI bus >>> > for multiple transactions), and getting those into the tree would have >>> > required updating/testing other existing SPI drivers, based on feedback >>> > I >>> > received at the time. All I had was the RB450G that I developed and >>> > tested >>> > the driver with, so I really couldn't address that issue, and then work >>> > took >>> > me in some other direction entirely. Some or all of these spibus >>> > changes >>> > that I relied on might now be in the tree, I'm not sure offhand. I am >>> > sure >>> > though that a huge stack of other things I need to get through has >>> > chronically kept me from updating that driver to current and retesting. >>> > >>> > When I wrote that driver, I put a lot of effort into testing it against >>> > as >>> > many different cards as I could obtain at the time - I believe 30 or so >>> > in >>> > total, all the details are in the code that was posted to the list back >>> > then. I encountered a number of strange/unexpected behaviors in that >>> > set of >>> > cards, and all of that hard-won knowledge is in that driver, including >>> > a >>> > much less complex fix for a shifted-response-data issue than you will >>> > see if >>> > you look at the Linux mmcpsi driver (as I recall, the Linux driver has >>> > code >>> > to arbitrarily bit-shift card response data, and to detect when that >>> > should >>> > be done, but it turns out that can be avoided entirely by inserting >>> > idle >>> > cycles in the right place when sending the command). >>> >>> Well, we should add the SPI bus reservation code and churn stuff as >>> needed. I think that'd be a great addition. >>> >>> Do you have a patchset somewhere? >>> >> >> >> Just going from memory here - there is what I posted to the list, then at >> some point Luiz took a stab at updating it to then-current (I should have a >> copy of those somewhere - not sure where else they went, if anywhere), and >> beyond that, I think there's a harmless but unnecessary conditional in the >> original code that could be removed. >> >> > > For reference, my original patchset and the work-in-progress update Luiz > sent me a few months later are now available at > https://people.freebsd.org/~pkelsey/mmcspi/ > > -Patrick >