From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-2.5 required=3.0 tests=DKIMWL_WL_HIGH,DKIM_SIGNED, DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,SPF_PASS, URIBL_BLOCKED,USER_AGENT_MUTT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id CA420C43381 for ; Fri, 8 Mar 2019 11:29:36 +0000 (UTC) Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 782C720811 for ; Fri, 8 Mar 2019 11:29:36 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=lists.infradead.org header.i=@lists.infradead.org header.b="EbF5Bbfx" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 782C720811 Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=the-dreams.de Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=linux-arm-kernel-bounces+infradead-linux-arm-kernel=archiver.kernel.org@lists.infradead.org DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20170209; h=Sender:Content-Type:Cc: List-Subscribe:List-Help:List-Post:List-Archive:List-Unsubscribe:List-Id: In-Reply-To:MIME-Version:References:Message-ID:Subject:To:From:Date:Reply-To: Content-Transfer-Encoding:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Owner; bh=hz5X4nR5ZCsfJnlFr5ilX7VjHg2Pg0kxrLMaGIiz4JU=; b=EbF5BbfxJjwBY+cuH7WH8sI/k BhfyTYBNdp2GirbbJBesXtjnoNFxCpTMxU34msh1p6vqjQ3qJXV0GtYiblA7VK8ZTynr6fs6+gIgQ x+8E9HTpSmW2DpNyTfXQLKB2XRdbw2jrSbRdzK+QnrZxT2shmGcwZ1X/jxceoIz4uEguM/xUHxCZu iRYIHrvV4DHnesta2a2/nkRL+sF/cZuk/gf73JH6TtPVMuale3Pkre/G2R9hnk6A3anXQ/7L8nM0U HYsrygnDr68bqSgWuk15zzn1FN6r1KsvIUQjQ8K8te8+1aM50zWJeYW8ykmlOcEIRTKOg7yfJ586f LduJ6y+/g==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.90_1 #2 (Red Hat Linux)) id 1h2Dgt-0007sV-Lu; Fri, 08 Mar 2019 11:29:27 +0000 Received: from sauhun.de ([88.99.104.3] helo=pokefinder.org) by bombadil.infradead.org with esmtp (Exim 4.90_1 #2 (Red Hat Linux)) id 1h2Dgq-0007s6-11; Fri, 08 Mar 2019 11:29:25 +0000 Received: from localhost (p54B3343A.dip0.t-ipconnect.de [84.179.52.58]) by pokefinder.org (Postfix) with ESMTPSA id 522972C3F83; Fri, 8 Mar 2019 12:29:20 +0100 (CET) Date: Fri, 8 Mar 2019 12:29:19 +0100 From: Wolfram Sang To: Hsin-Yi Wang Subject: Re: [PATCH] i2c: mediatek: modify threshold passed to i2c_get_dma_safe_msg_buf() Message-ID: <20190308112919.GA1674@kunai> References: <20190215090202.157100-1-hsinyi@chromium.org> <20190215090959.soxkf3ho3or2geme@ninjato> <20190215092500.6q3hqnoufyowiqaz@ninjato> <20190215163657.fs6t7p3vqez53su3@ninjato> MIME-Version: 1.0 In-Reply-To: User-Agent: Mutt/1.10.1 (2018-07-13) X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20190308_032924_368326_33AAB97C X-CRM114-Status: GOOD ( 15.66 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Ryder Lee , qii.wang@mediatek.com, Jun Gao , linux-kernel@vger.kernel.org, linux-mediatek@lists.infradead.org, linux-i2c@vger.kernel.org, Matthias Brugger , linux-arm-kernel@lists.infradead.org Content-Type: multipart/mixed; boundary="===============0096953204181064480==" Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+infradead-linux-arm-kernel=archiver.kernel.org@lists.infradead.org --===============0096953204181064480== Content-Type: multipart/signed; micalg=pgp-sha512; protocol="application/pgp-signature"; boundary="6c2NcOVqGQ03X4Wi" Content-Disposition: inline --6c2NcOVqGQ03X4Wi Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Fri, Feb 22, 2019 at 02:04:11PM +0800, Hsin-Yi Wang wrote: > Thanks for the solution. > Previously we were testing if the driver can handle zero-length > transfer, but it turns out it will timeout. (Also checked this from > mtk's datasheet) > Adding original owner qii.wang to verify that. We'll apply this after > verification. I just checked this issue again and concluded that both are reasonable, the suggestion from me below with the adapter quirk AND your original patch setting the threshold to 1. With my suggestion the core will prevent 0-length messages. But still, we should set the threshold to 1 because 0 is a value the HW is not capable of. >=20 > On Sat, Feb 16, 2019 at 12:36 AM Wolfram Sang wrote: > > > > > > >> > Ok, I can add a check in another patch. Should we return NULL poin= ter > > >> > if msg->len is 0 or print out some warnings? Thanks. > > >> > > >> No warning, msg->len =3D=3D 0 is a valid setting. But interesting qu= estion: > > >> I was about to say NULL, but your driver would assume ENOMEM there a= nd > > >> discard the message which is also not correct since msg->len =3D=3D = 0 is a > > >> valid setting. So, should we just return msg->buf then? Will this wo= rk > > >> with your driver? Can it handle zero-length transfers? > > > > > > dma_map_single(i2c->dev, msg->buf , msgs->len, DMA_TO_DEVICE); breaks > > > kernel if msgs->len is 0, so I think it doesn't handle zero-length tr= ansfer. > > > > Please don't drop the lists. > > > > Then, the correct solution is to forbid those transfer with this > > controller. Check I2C_AQ_NO_ZERO_LEN. Also, update the functionality > > like this .. (I2C_FUNC_SMBUS_EMUL & ~I2C_FUNC_SMBUS_QUICK). > > --6c2NcOVqGQ03X4Wi Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iQIzBAABCgAdFiEEOZGx6rniZ1Gk92RdFA3kzBSgKbYFAlyCUgsACgkQFA3kzBSg Kba9Yg/+M7cbMDhNMb4QMvsx2CXavB/39rfypl8ZMb3+9ie+XUgHO69Eni+lZyyn z8TcGgTAoQaYepbdDLMgQdrppkIf+JdZPBLoeFQ+Gom9c6qGME0ib8bc+ZltG9BV INl6N9P3ZtRSjccRcGGcicjQGi32ctmYYqwr82tXD9xDuaOYM1Mch9Boet7bnsj8 vaO/CmVHhg7dUjx/TZAVbvHmhcG6GudqvYEbBZM5kwinZzy7O78usan9imr2saYC c71Tij0lTgoEVhEqZac+166BZccT8qXaJPYs8t9Vclu5PmKkeuU+lSzMsBAdiQcJ U1YbFIH6xPa1up1o53AcSsHeaZmKI/X6ph9g7MuqqLFvej8MbfXIz9Swix3kjiOd yzYyqPdqOyl0bQ5k8DJI9XT2phnOMixHHlhwn2n9TGDFQpfOh5kUqJ0bn9Qc/ydt eR0c0Sj3CQDQQk6RyJOvv+svdsknVBHgL8md7rsu3PRnPXJrnNAEvf4L+QFLNhpj Y6WshPVyqbhUt3V/sXOUVyhBMX5j+I8KPvlSmtYQZxpx0b58EzUduk5spdjy/x/o KVvwXFuGCNSWB9Hhb/nKPNcwyVd7w+EhqOgdKK+Uz8dsar14UBTy7NDrdxvQ4WBj rE/ZTfbfK/lFppbEx1nIDGtlse1TJW92mHYfM+2SzkDaHtw6lqM= =Q2xm -----END PGP SIGNATURE----- --6c2NcOVqGQ03X4Wi-- --===============0096953204181064480== Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Disposition: inline _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel --===============0096953204181064480==--