Received: by 10.223.164.202 with SMTP id h10csp661646wrb; Wed, 15 Nov 2017 06:04:05 -0800 (PST) X-Google-Smtp-Source: AGs4zMbq44GeYKjZyKuyuJS9t1EwHqZPSA3GM0fTRuNpVtm2gjB2c9xP7Bbxa7sVIm7MueSypvTd X-Received: by 10.84.210.66 with SMTP id z60mr16232455plh.168.1510754645835; Wed, 15 Nov 2017 06:04:05 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1510754645; cv=none; d=google.com; s=arc-20160816; b=bS5I47McYbX+bC+c+gl3yR44/nEJHoZiNvME/pAXQ9aThGlHe80EAwXM1QgeMp7x4z jC0CLwZY5DkxyYx1BMZpy5kLPjWI0PcwBZpus8rcfwMaWvedRRhteZSRbSUG1RJkMx2e dkqv+bvteUGT89qrgEnekz6rYH76lkxID/TtWeVBpdJe5+uVOdBbG1FP7glEDt5Qr0jg SxOuvwRmcuRNfHHLch6wql+XOcpkcPzS4NcO14C4QA/MIBCK40TvWQr0YzfNtIaOYY7B y2M1M6VCZooMoIwv/mh4HN4JU1GRAD5xxdeEjxf7Yg+apKXexM5EU7rLWNFEVWHOqUPg wqcg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:spamdiagnosticmetadata :spamdiagnosticoutput:user-agent:in-reply-to:content-disposition :mime-version:references:message-id:subject:cc:to:from:date :dkim-signature:arc-authentication-results; bh=Ivchf73aGWAmEhHhFDG9r0IZ8wi1H1hSck/bB4hFtmw=; b=LAaevj1LNHfwLDkQ1cQVfAXo2Q/XLK8+IwKzYkCRl0bbCzAQLkGO+h9NpEDwnFV6LH 2SlH4rGURkDnuVVCZ4In3S/ahQDKdqL2L/skJwyeJpNaxSC0lKtmS1+go8oKpAvjZBEm nux/iB4VyYPvR3BXyGFVkbjSb1pf6qFreFiMJxruKJJGa3WaBwDyp529s9npfxjG+jvF RAVBtKAcyi6HqltcxGka0whedhVSp6/yWypP/ZSkdrzWy7m0lQGLlXzwNZ1u426DkHp1 Uouhd0OqrCFjHEOk1afPrtTgKnKtbOGwfClhnnQPZAgxTnuTWBvjwbOE9iAiXlcHlR17 yqHQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@CAVIUMNETWORKS.onmicrosoft.com header.s=selector1-cavium-com header.b=BxlKNiW5; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id q17si6954171pfj.31.2017.11.15.06.03.52; Wed, 15 Nov 2017 06:04:05 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@CAVIUMNETWORKS.onmicrosoft.com header.s=selector1-cavium-com header.b=BxlKNiW5; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S932515AbdKOMIN (ORCPT + 90 others); Wed, 15 Nov 2017 07:08:13 -0500 Received: from mail-by2nam03on0080.outbound.protection.outlook.com ([104.47.42.80]:17402 "EHLO NAM03-BY2-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1752424AbdKOMIK (ORCPT ); Wed, 15 Nov 2017 07:08:10 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=CAVIUMNETWORKS.onmicrosoft.com; s=selector1-cavium-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version; bh=Ivchf73aGWAmEhHhFDG9r0IZ8wi1H1hSck/bB4hFtmw=; b=BxlKNiW5PD5kQ+dMtw0YHLTzrZcOp2QqSxv68GFmwk2D2zFBG4m46H1ou5kfR+4vbAliP/hr2KijzEgXT0GfpwJWuxk0gYSZvxlWwhkRW83xnffI3zLnAHywwDpPC/P8i5puiOlgKreM4RwVn3h3lTHYZpiG93pGYQ2LdafhhvE= Authentication-Results: spf=none (sender IP is ) smtp.mailfrom=Jan.Glauber@cavium.com; Received: from hc (46.5.204.193) by CO2PR07MB2581.namprd07.prod.outlook.com (10.166.201.20) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384_P256) id 15.20.218.12; Wed, 15 Nov 2017 12:08:07 +0000 Date: Wed, 15 Nov 2017 13:07:54 +0100 From: Jan Glauber To: Marc Kleine-Budde Cc: Mark Brown , Tim Harvey , linux-spi@vger.kernel.org, "linux-kernel@vger.kernel.org" , Wolfgang Grandegger , linux-can Subject: Re: MCP251x SPI CAN controller on Cavium ThunderX Message-ID: <20171115120754.GC3011@hc> References: <20171114120207.xbee2cgsai4qka46@sirena.org.uk> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.5.21 (2010-09-15) X-Originating-IP: [46.5.204.193] X-ClientProxiedBy: AM4PR0501CA0065.eurprd05.prod.outlook.com (10.172.222.161) To CO2PR07MB2581.namprd07.prod.outlook.com (10.166.201.20) X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 23daf50a-940c-496a-f379-08d52c21891e X-Microsoft-Antispam: UriScan:;BCL:0;PCL:0;RULEID:(22001)(4534020)(4602075)(4627115)(201703031133081)(201702281549075)(2017052603199);SRVR:CO2PR07MB2581; X-Microsoft-Exchange-Diagnostics: 1;CO2PR07MB2581;3:oWJ6AJT9MOohkciuo7KJgnniDgGYZ5aJdrOxVVH5k6Xm2otqQp3UJt/JErt1kOOFwLxc7iuCgtthwmh0esIiYEGITzR08KoKl9ozmT8g8lxBUEbX+QHMHF7iRYgwgsk6josPE4DURibc9cycZfAVmaDGra27OXSYOexhB1h90bqANPLfSIllJLR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udR1HziVn1bueIzdbE2e0QR8TIRA43oDZnhAzbr5Fakg88ZgmUKrfYeSj5hs+kZ9rAXa4YGyGsnXzFyAfcEpvuaDmFpVNOjL7azNoAXnkYQwbTaxmykVJPZCw0bxYXSLwAyfYiejNCB/4kLkLeC7i+EymxsnIfNqrUPFlIQ2pMijZEJd29BoREj1ZifT8gFSoRq0Z16pPIr27XKOarHsz760gRLrcUkwN2aATe3kXSvqBFGq+rOsSdBbYThZteoLCbfmlfUnGI7wxzMhLCc9LhUfK9aqrhxz9e4=;4:qtOMinTLVZwICjopmxjogaskQ253nGPHDvQMS8rIWpAAy1P+rJTy60iT2BE+WDGNY4SS5ayALQdFKoOnD9fGTDH80Q5U5Y1ly27/rZL3lseUtID5bjKKmjfCUaDSJ7v0LzMO1NbeW27yM6yKkJz6wtMbYGdKuxWGLjvWoWs2KumCkQtnB90P7smOjPJMSY4WRTIkxfZKnp9uAgsOtZgk7lnvuOFkeilEYf2aG21IrIR1AVI3Nxp4osipI67dmwFllp7G0h0keP24U7LsNQ70xA== X-Microsoft-Antispam-PRVS: X-Exchange-Antispam-Report-Test: UriScan:; X-Exchange-Antispam-Report-CFA-Test: BCL:0;PCL:0;RULEID:(100000700101)(100105000095)(100000701101)(100105300095)(100000702101)(100105100095)(6040450)(2401047)(5005006)(8121501046)(3231022)(93006095)(10201501046)(100000703101)(100105400095)(3002001)(6041248)(201703131423075)(201702281528075)(201703061421075)(201703061406153)(20161123560025)(20161123562025)(20161123558100)(20161123555025)(20161123564025)(6072148)(201708071742011)(100000704101)(100105200095)(100000705101)(100105500095);SRVR:CO2PR07MB2581;BCL:0;PCL:0;RULEID:(100000800101)(100110000095)(100000801101)(100110300095)(100000802101)(100110100095)(100000803101)(100110400095)(100000804101)(100110200095)(100000805101)(100110500095);SRVR:CO2PR07MB2581; X-Forefront-PRVS: 0492FD61DD X-Forefront-Antispam-Report: SFV:NSPM;SFS:(10009020)(6009001)(346002)(376002)(189002)(24454002)(199003)(66066001)(83506002)(2950100002)(58126008)(6666003)(6916009)(42882006)(6496005)(5660300001)(6246003)(47776003)(305945005)(33716001)(16586007)(316002)(16526018)(189998001)(7736002)(68736007)(53936002)(97736004)(478600001)(54906003)(53546010)(8936002)(54356999)(72206003)(101416001)(33656002)(229853002)(106356001)(81166006)(50466002)(55016002)(6116002)(2906002)(1076002)(3846002)(23726003)(551934003)(4326008)(81156014)(105586002)(25786009)(9686003)(50986999)(8676002)(76176999)(18370500001)(217873001);DIR:OUT;SFP:1101;SCL:1;SRVR:CO2PR07MB2581;H:hc;FPR:;SPF:None;PTR:InfoNoRecords;MX:1;A:1;LANG:en; Received-SPF: None (protection.outlook.com: cavium.com does not designate permitted sender hosts) X-Microsoft-Exchange-Diagnostics: =?us-ascii?Q?1;CO2PR07MB2581;23:GQcenQ5UeUCP+P0UKw84CKwF/YbsW1UHIJdZiLtQO?= =?us-ascii?Q?KNE+6RF+jBvvVC9Tr4v06R9JUsISUCjKMwvvLf7+ZbW/gJX0tdt/jUO9ymeY?= =?us-ascii?Q?ivtxXEJ26/pEja16gXgUn71REEEQ9R7b8Qxple+NnFwnATyGtlYbIMQ/C5D0?= =?us-ascii?Q?Ofg2Wt+i3svRVGj+jveI838jEJzrINCorQFIPFvI6BUJ+Fl2kcB4P31G8NAa?= =?us-ascii?Q?gKFpZpQ0o5fh3kRMdanf0uMatv0oDyk15i+n0UEIAqKrnvz1+tLNfAlxaKW0?= =?us-ascii?Q?FzW72yExIzxMUal02o0rS3CBWaSUhYq3AEU9DFfFqxWQyFRGA+r0FPx3cqsc?= =?us-ascii?Q?FsOXH4lvKxUPsIuNpIVZJ0d+c/PHjzC7AnuBKjxeat+ktz+GjbHrbMIRcdzn?= =?us-ascii?Q?l6iHVA2scWgd4oRJVW+Ma9vkDbeKhVGydQYMqScQy5COglT/1NC3vlYNdKpv?= =?us-ascii?Q?zHT9Eikoo9NlaWGfQYMTCwU20QBnb0qCfqdiRas/l5WOMPl66g/djCgTZnTu?= =?us-ascii?Q?2yhS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X0g7whhTsP+luErYcSenPIfZJzuPtJhO7ELtjzzg9g1ZkKX8jkEaoF0JMVTdVdVJKWJAE6dfiItoGBTFdm0BnpWOFApuZhZHMPSvdugH+RmmQpM3kJT+73GV6hPRsOVeqL+sM0ucwH7N/M5+dm6dOp5ai4ISxpL5mCEtGW0aHJ6m6HgFtrNjrbOWqrJuvNl87jUc+Zh7F75Ri1HVv7e6XoRJfv1AsHAa+xZZxF7U70ETtFdQZQTDsbSTJPMgJ3n23E2X/TtOZVLoxafWx5fX3XKoKYtF5hHBp2X8CD44=;5:dgPBt0TJJm4P9SMfUIKv10ZagypTs0O/bS2UvjFfCdHRufRhm+mF7dbS0QPZHRh39yZkXYMLKmgnjH4Wb+MxvUdRKVno/cGWPY8DN5QCx/R3ftXzFgnDEkl8CNxmsEIKhdIFnesq7TPM+ukIq6VfC8iriEU48iF1b5w8cHJAqng=;24:Oq7A7bgdrBfGEQMQWoY5huQneppra930ioChEa5WXtSKbmATgr84Zw4j4B1Hq55nk/JaV7b5pepNvTsQVYQq3wfxxTS7PLqCdThjlS0y9to=;7:H2nyJRPsaQZXojZzEnQ1i2TxN+Urktcha/u7oLomVqcK2hmmbYS9J8L801IRWJ139/NFoZJM13MiWMKlAADFvkHuLRUbVm1+czRpFMJ7ASbvsnqU++XXOsF0g8pTpEmZsyzOwVMQXiHVvfzD2Aqkipn2LCNnW4E0hXo+Cd34aM6Iql1hAupgMep4LPP40rq+ltscdgjJPhX0FYDNJ8Epo2SsFjvQqZhosENOTt1BC3HlRz8scx8O2GC0d4LXOi8h SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-OriginatorOrg: caviumnetworks.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 15 Nov 2017 12:08:07.1655 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 23daf50a-940c-496a-f379-08d52c21891e X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 711e4ccf-2e9b-4bcf-a551-4094005b6194 X-MS-Exchange-Transport-CrossTenantHeadersStamped: CO2PR07MB2581 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Wed, Nov 15, 2017 at 11:54:20AM +0100, Marc Kleine-Budde wrote: > On 11/14/2017 01:02 PM, Mark Brown wrote: > > On Mon, Nov 13, 2017 at 01:17:42PM -0800, Tim Harvey wrote: > > > >> When a register is read from the mcp251x driver the > >> octeon_spi_do_transfer() gets a spi_message with a single spi_xfer of > >> len=3, a tx_buf, and an rx_buf which I believe is supposed to shift > >> out 3 bytes out MOSI and shift in 3 bytes from MISO where the last > >> byte shifted in would be the response. > > > > No, that will simultaneously transmit and recieve three bytes. > > That's what the driver supposed to do. > > > If you want to transmit two bytes and then recieve one byte you need > > two xfers, one with a len of 2 and a tx_buf, the other with a len of > > 1 and a rx_buf. > To read a register (mcp251x_read_reg()) the mcp251x does a 3 byte full > duplex transfer. The first byte send is the command (read register) the > second byte the register number the third byte is a dummy. The first 2 > bytes received are ignored the 3rd byte is the register contents. To support this full duplex transfer the Cavium SPI controller needs to know the receive lenght before setting up the transaction. spi_transfer only includes the total length, so I don't see how this should work. --Jan From 1584139669779375728@xxx Wed Nov 15 13:41:56 +0000 2017 X-GM-THRID: 1583987213767022680 X-Gmail-Labels: Inbox,Category Forums,HistoricalUnread