Linux-ARM-Kernel Archive on lore.kernel.org
 help / color / mirror / Atom feed
From: Wolfram Sang <wsa@the-dreams.de>
To: Hsin-Yi Wang <hsinyi@chromium.org>
Cc: Ryder Lee <ryder.lee@mediatek.com>,
	Jun Gao <jun.gao@mediatek.com>,
	linux-kernel@vger.kernel.org, linux-mediatek@lists.infradead.org,
	linux-i2c@vger.kernel.org,
	Matthias Brugger <matthias.bgg@gmail.com>,
	linux-arm-kernel@lists.infradead.org
Subject: Re: [PATCH] i2c: mediatek: modify threshold passed to i2c_get_dma_safe_msg_buf()
Date: Fri, 15 Feb 2019 17:36:57 +0100	[thread overview]
Message-ID: <20190215163657.fs6t7p3vqez53su3@ninjato> (raw)
In-Reply-To: <20190215092500.6q3hqnoufyowiqaz@ninjato>


[-- Attachment #1.1: Type: text/plain, Size: 892 bytes --]


>> > Ok, I can add a check in another patch. Should we return NULL pointer
>> > if msg->len is 0 or print out some warnings? Thanks.
>> 
>> No warning, msg->len == 0 is a valid setting. But interesting question:
>> I was about to say NULL, but your driver would assume ENOMEM there and
>> discard the message which is also not correct since msg->len == 0 is a
>> valid setting. So, should we just return msg->buf then? Will this work
>> 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 transfer.

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).


[-- Attachment #1.2: signature.asc --]
[-- Type: application/pgp-signature, Size: 833 bytes --]

[-- Attachment #2: Type: text/plain, Size: 176 bytes --]

_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

  reply	other threads:[~2019-02-15 16:37 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-02-15  9:02 [PATCH] i2c: mediatek: modify threshold passed to i2c_get_dma_safe_msg_buf() Hsin-Yi Wang
2019-02-15  9:09 ` Wolfram Sang
2019-02-15  9:17   ` Hsin-Yi Wang
2019-02-15  9:25     ` Wolfram Sang
2019-02-15 16:36       ` Wolfram Sang [this message]
2019-02-22  6:04         ` Hsin-Yi Wang
2019-03-08 11:29           ` Wolfram Sang
2019-03-08 14:39             ` Hsin-Yi Wang
2019-03-08 14:52               ` Wolfram Sang
2019-03-08 16:22                 ` Hsin-Yi Wang
2019-03-09  9:42 ` Wolfram Sang

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20190215163657.fs6t7p3vqez53su3@ninjato \
    --to=wsa@the-dreams.de \
    --cc=hsinyi@chromium.org \
    --cc=jun.gao@mediatek.com \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-i2c@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-mediatek@lists.infradead.org \
    --cc=matthias.bgg@gmail.com \
    --cc=ryder.lee@mediatek.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox