Received: by 2002:ac0:aa62:0:0:0:0:0 with SMTP id w31-v6csp1046567ima; Wed, 24 Oct 2018 13:26:30 -0700 (PDT) X-Google-Smtp-Source: AJdET5ffVg4Hc8lhjogFhuxnm1b9EEVi09aSrKdmiRAW7oemOYY4e74FO4D9frxgrLPMVxi/9k+C X-Received: by 2002:a17:902:5a43:: with SMTP id f3-v6mr3855815plm.114.1540412790316; Wed, 24 Oct 2018 13:26:30 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1540412790; cv=none; d=google.com; s=arc-20160816; b=ccWgSjwyAF2E2RNlHLlUZOTBZnGlPMOU2dBcFmLVaueCvhTc4saN5OLbCmP/JU2HEO 5qUdUFEeUAVFaLuBUo2rWIYChExFjeksKE8Qhwl6ZvnKaNMfGudq1zYmAxJnEaWXhesW JN/pyhPkQVq0HW/XCA5GCkoOkNkCJ4N1HOvGErRLDIgSpjeFZKFERUYWgvzF4jvBOjoW KXCssXl3ljcqwsKv8oE4qiU4oLwtyFPlOEW1fLDFOiMkxvRgPK5gEyqfQYW8vnTDiYcN 8LJAiL0b7HEqw+VYgSpELNmgPTSa2YCQBGPc1LBvQIg4QsvSCf5Z+q1CQyLdFgG+hmLT O2wg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding :content-language:in-reply-to:mime-version:user-agent:date :message-id:from:references:cc:to:subject:dkim-signature; bh=cG6/6w/sMBsblny11mm4W3i6AOxcGBq7XzNocbJ2Uc8=; b=FvisttgLjLU2M5Kv52YiP+wNIBG2a712p6p9CSS/SLv88vLBAf5DbWOnNlVPv10IdE nprebugpCohxooYv801OWmpE61QY+a7nD6noCXhVQsWtOMpAFO4DnU7nLf7caqG2AwnL x2lHZQq/4nRTB4yzbMm8B9paXQmIlAY1R5pUMsgikTNsh3otmLgm6kKhbFNh/XKA06RV V9+BsVZAX6ZHs01nove+Fy+DV6hD2qccrf97PPWTCJ5aWiRmHmGOyuJbUzVUdWtFg9xd CC2k4DE6umVyBFF6yQOaohuUr19SQh8zTDhEs0Dl7gkDXh2cLelkumgKUQM4zkTndotp nNJQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@ti.com header.s=ti-com-17Q1 header.b=cztFMmti; 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; dmarc=pass (p=QUARANTINE sp=NONE dis=NONE) header.from=ti.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id 138-v6si5307268pgc.218.2018.10.24.13.26.14; Wed, 24 Oct 2018 13:26:30 -0700 (PDT) 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=@ti.com header.s=ti-com-17Q1 header.b=cztFMmti; 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; dmarc=pass (p=QUARANTINE sp=NONE dis=NONE) header.from=ti.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726433AbeJYEzX (ORCPT + 99 others); Thu, 25 Oct 2018 00:55:23 -0400 Received: from fllv0016.ext.ti.com ([198.47.19.142]:35098 "EHLO fllv0016.ext.ti.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725779AbeJYEzW (ORCPT ); Thu, 25 Oct 2018 00:55:22 -0400 Received: from dlelxv90.itg.ti.com ([172.17.2.17]) by fllv0016.ext.ti.com (8.15.2/8.15.2) with ESMTP id w9OKPItO011779; Wed, 24 Oct 2018 15:25:18 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ti.com; s=ti-com-17Q1; t=1540412718; bh=cG6/6w/sMBsblny11mm4W3i6AOxcGBq7XzNocbJ2Uc8=; h=Subject:To:CC:References:From:Date:In-Reply-To; b=cztFMmti/HyoLGsoz/UnyCqBds7l05xsSRQtsuq3QuHqrJBzw1kRVMOare1veumOe XfUIHKWYkOkSr8VcrM/xMUou6csXTPwnjSBgXVPE/1Tr43XHJlz4/SS112gqR4Fhdr NXunAGYtNUdnC+JP63pqHXqshONOF+QF0uRx0Nxo= Received: from DFLE104.ent.ti.com (dfle104.ent.ti.com [10.64.6.25]) by dlelxv90.itg.ti.com (8.14.3/8.13.8) with ESMTP id w9OKPHgG015319; Wed, 24 Oct 2018 15:25:17 -0500 Received: from DFLE112.ent.ti.com (10.64.6.33) by DFLE104.ent.ti.com (10.64.6.25) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256_P256) id 15.1.1466.3; Wed, 24 Oct 2018 15:25:17 -0500 Received: from dflp33.itg.ti.com (10.64.6.16) by DFLE112.ent.ti.com (10.64.6.33) with Microsoft SMTP Server (version=TLS1_0, cipher=TLS_RSA_WITH_AES_256_CBC_SHA) id 15.1.1466.3 via Frontend Transport; Wed, 24 Oct 2018 15:25:17 -0500 Received: from [128.247.59.147] (ileax41-snat.itg.ti.com [10.172.224.153]) by dflp33.itg.ti.com (8.14.3/8.13.8) with ESMTP id w9OKPHpr030514; Wed, 24 Oct 2018 15:25:17 -0500 Subject: Re: [PATCH v9 6/9] i3c: master: Add driver for Cadence IP To: Boris Brezillon , Wolfram Sang , , Jonathan Corbet , , Greg Kroah-Hartman , Arnd Bergmann CC: Przemyslaw Sroka , Arkadiusz Golec , Alan Douglas , Bartosz Folta , Damian Kos , Alicja Jurasik-Urbaniak , Cyprian Wronka , Suresh Punnoose , Rafal Ciepiela , Thomas Petazzoni , Nishanth Menon , Rob Herring , Pawel Moll , Mark Rutland , Ian Campbell , Kumar Gala , , , Vitor Soares , Geert Uytterhoeven , Linus Walleij , Xiang Lin , , Sekhar Nori , Przemyslaw Gaj , Peter Rosin , Mike Shettel , Stephen Boyd , Joe Perches References: <20181022133404.2061-1-boris.brezillon@bootlin.com> <20181022133404.2061-7-boris.brezillon@bootlin.com> <20181024202048.7e3534f7@bbrezillon> From: Grygorii Strashko Message-ID: <99a506e3-d9d5-0d3e-26e1-031447c14857@ti.com> Date: Wed, 24 Oct 2018 15:25:17 -0500 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:60.0) Gecko/20100101 Thunderbird/60.2.1 MIME-Version: 1.0 In-Reply-To: <20181024202048.7e3534f7@bbrezillon> Content-Type: text/plain; charset="utf-8"; format=flowed Content-Language: en-US Content-Transfer-Encoding: 7bit X-EXCLAIMER-MD-CONFIG: e1e8a2fd-e40a-4ac6-ac9b-f7e9cc9ee180 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 10/24/18 1:20 PM, Boris Brezillon wrote: > Hi Arnd, > > On Mon, 22 Oct 2018 15:34:01 +0200 > Boris Brezillon wrote: > > >> + >> +static void cdns_i3c_master_rd_from_rx_fifo(struct cdns_i3c_master *master, >> + u8 *bytes, int nbytes) >> +{ >> + readsl(master->regs + RX_FIFO, bytes, nbytes / 4); > > Vitor reported a problem with readsl(): this function expects the 2nd > argument to be aligned on 32-bit, which is not guaranteed here. Unless > you see a better solution, I'll switch back to a loop doing: > > for (i = 0; i < nbytes; i += 4) { > u32 tmp = __raw_readl(...); Pls, do not use __raw io. > memcpy(bytes + i, &tmp, > nbytes - i > 4 ? 4 : nbytes - i); > } > >> + if (nbytes & 3) { >> + u32 tmp; >> + >> + readsl(master->regs + RX_FIFO, &tmp, 1); >> + memcpy(bytes + (nbytes & ~3), &tmp, nbytes & 3); >> + } >> +} > > Regards, > > Boris > -- regards, -grygorii