Received: by 2002:ac0:98c7:0:0:0:0:0 with SMTP id g7-v6csp3609380imd; Mon, 29 Oct 2018 09:36:22 -0700 (PDT) X-Google-Smtp-Source: AJdET5dEP+94+YJbuSozxafKnFiIdyK2i5lavybh2B8575chuzX43k+TIOBA1Qb24RwmJXe2teG7 X-Received: by 2002:a17:902:7146:: with SMTP id u6-v6mr1863195plm.322.1540830982500; Mon, 29 Oct 2018 09:36:22 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1540830982; cv=none; d=google.com; s=arc-20160816; b=S2avt7REAVW4u2YdT6YZwoPeXbgeCnFe+YeglkeZy6NnjugMhvmt3kvw0rmEk2u8hr VQmHXmgO9t1D+tRH/41tp6OC+VmoCJ/UFkwVIA+EvGBQ+eCi1GDYv4EbJ/UJdRgf7Nl9 f/tdw3enpRNr+4Ds7nWgLOz2U33CQsdAtz6furXyljFDQ4pyaOANKiFcUCHJ8GglRUuZ yZr0d1VnywGStpb6aQLu5yNdZGQVavwxF09LC6Yf9TLB7GLXyTXUcZiZPQ19LfThKpyQ lsq9KK1vZRfvebiAcGiXkJqy0ULMECrm+kxnQLHIJB/KMHTgVMeGHVdgD1/rE4AHcXQi lHwQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-language :content-transfer-encoding:in-reply-to:mime-version:user-agent:date :message-id:references:cc:to:from:subject:dkim-signature; bh=NNILUclF2YksZLNcLmr/Qd5pjkkJZsvpg7fMEBWQxMM=; b=CAQmaRgLODkQWPYJb+RYDkZwGaQAlT5+3xkyWCQ8WTsTwmy2atk0y5jgtaffYwtFbj 7yAKKg689+WruVN9vXCySL/7H4jpbvcGkaWWAsSdvu7narnRaJAQ3XiOiD9Ib+zBeIlN FxWesn3frJVDuqWq02FF3ZX6B01PPQ94KPzWqVH7xcXJbpOMngOoW5qscAvB73QxiTMo u7ct98k+GytWrfUPCpgQ9OfU6G/pK186mP13ZUBEoQBQ5mkKasoevLtZIhUHtobsJuYN GmoSCAm+wttrI8+u1U35/ALDhty4SPShPRUmRAOO9JF0GWB5HAu9xz5Q6GV4+oRfXQ8V X7zQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=F733L5cq; 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=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id c189-v6si21904459pfa.106.2018.10.29.09.36.06; Mon, 29 Oct 2018 09:36:22 -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=@gmail.com header.s=20161025 header.b=F733L5cq; 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=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728024AbeJ3BYm (ORCPT + 99 others); Mon, 29 Oct 2018 21:24:42 -0400 Received: from mail-pf1-f196.google.com ([209.85.210.196]:32803 "EHLO mail-pf1-f196.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727880AbeJ3BYl (ORCPT ); Mon, 29 Oct 2018 21:24:41 -0400 Received: by mail-pf1-f196.google.com with SMTP id a15-v6so4310828pfn.0; Mon, 29 Oct 2018 09:35:21 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=subject:from:to:cc:references:message-id:date:user-agent :mime-version:in-reply-to:content-transfer-encoding:content-language; bh=NNILUclF2YksZLNcLmr/Qd5pjkkJZsvpg7fMEBWQxMM=; b=F733L5cqxa8KGMzjDWDU4WYgPjsYodctTd5dqg4pVMVFCNDxZHAkjoPXy+4g+YIm62 NFbUnu57mOAK/4KdHe++seNLsk0g0Ne7yJQWslt1/YZjqa8DqEKIf4zJ4fjO7TAMt6Zy sSA5Vdv9BXQDCOybkZOnf03NfmyfHUGaQmKnMg0NwB1GB5rsvsI01ck3nEmn4MJp0VR6 7H73aDdnq6v5F10zZ0kNsuT5AXMT6zaETWTytFpIHdnFDpdrL96wRXVpDVKu8vNETIuA xpQjHi0v4aSq4etthb4VhXSbUk2aHm7EHrJToT0jLX5b0iJO+agr1OckTrcqS4DY7MLy 50wg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:subject:from:to:cc:references:message-id:date :user-agent:mime-version:in-reply-to:content-transfer-encoding :content-language; bh=NNILUclF2YksZLNcLmr/Qd5pjkkJZsvpg7fMEBWQxMM=; b=kd1f5tXqTHhKjrUXX8BWiCi0b6rJynYo+mes39vR09x6UudV92rmH4TuN8+/8nkPVn 2bBc+QY9VJWQkXdGPn5CfzWC7uIlsnZWECRXkUOc07P/qnXNngmWINGmJbyFRpk9TObz 0AL3Df1jX80JNfTHP5FlCRARZ4c4gKEhTvRpcjxxppxe6oMmwfSyYBjunyMjcRrxCXA8 k7rwhOnqNjraBhdwOQCmhl6q+d16/R8Cen52OEn8C+gu8BJY03zPmRn+JwbWpbKvCX2I qyz0+/xrvxaFy/8JYSw/Ni/7B3rGEq45joylLoQvtiCHMsthYbqzlZ9FHZdSfRZM5yfs v3sw== X-Gm-Message-State: AGRZ1gKTuy487UYiHD/nkCKPL3g4k23ngqcnskcYKk9Wv9c3MXTfHau0 nUuHvu4ImwJG2rZBEo0HaDXK8jpqze0= X-Received: by 2002:a62:1c0f:: with SMTP id c15-v6mr15880886pfc.14.1540830920342; Mon, 29 Oct 2018 09:35:20 -0700 (PDT) Received: from [10.211.55.5] ([49.170.189.99]) by smtp.gmail.com with ESMTPSA id w2-v6sm37608365pfk.140.2018.10.29.09.35.17 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 29 Oct 2018 09:35:18 -0700 (PDT) Subject: Re: [PATCH] spi: dw: fix buffer end address From: Jaewon Kim To: Mark Brown , Jaewon Kim Cc: linux-spi@vger.kernel.org, linux-kernel@vger.kernel.org References: <1540395437-6623-1-git-send-email-jaewon02.kim@samsung.com> Message-ID: <762bc63e-7b01-0d77-3939-7b236dbda37f@gmail.com> Date: Tue, 30 Oct 2018 01:35:15 +0900 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: <1540395437-6623-1-git-send-email-jaewon02.kim@samsung.com> Content-Type: text/plain; charset=euc-kr; format=flowed Content-Transfer-Encoding: 8bit Content-Language: en-US Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org There is some side effect on this patch. So, I revoke this patch. 18. 10. 25. ???? 12:37?? Jaewon Kim ??(??) ?? ??: > Buffer address can be NULL, if user does not want to receive TX/RX data. > In this case, driver should not set the rx/tx_end value with len. > > Signed-off-by: Jaewon Kim > --- > drivers/spi/spi-dw.c | 8 ++++++-- > 1 file changed, 6 insertions(+), 2 deletions(-) > > diff --git a/drivers/spi/spi-dw.c b/drivers/spi/spi-dw.c > index b705f2b..34e6fca 100644 > --- a/drivers/spi/spi-dw.c > +++ b/drivers/spi/spi-dw.c > @@ -293,9 +293,13 @@ static int dw_spi_transfer_one(struct spi_controller *master, > dws->dma_mapped = 0; > > dws->tx = (void *)transfer->tx_buf; > - dws->tx_end = dws->tx + transfer->len; > + dws->tx_end = dws->tx; > + if (dws->tx) > + dws->tx_end += transfer->len; > dws->rx = transfer->rx_buf; > - dws->rx_end = dws->rx + transfer->len; > + dws->rx_end = dws->rx; > + if (dws->rx) > + dws->rx_end += transfer->len; > dws->len = transfer->len; > > spi_enable_chip(dws, 0);