From owner-svn-src-head@FreeBSD.ORG Thu Jan 2 10:53:33 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 04B09224 for ; Thu, 2 Jan 2014 10:53:33 +0000 (UTC) Received: from mail-ea0-f171.google.com (mail-ea0-f171.google.com [209.85.215.171]) (using TLSv1 with cipher ECDHE-RSA-RC4-SHA (128/128 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 8AF761B09 for ; Thu, 2 Jan 2014 10:53:32 +0000 (UTC) Received: by mail-ea0-f171.google.com with SMTP id h10so6162769eak.16 for ; Thu, 02 Jan 2014 02:53:30 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:message-id:date:from:organization:user-agent :mime-version:to:cc:subject:references:in-reply-to:content-type :content-transfer-encoding; bh=og+2hHbsGqUyKlNwXdY0xcSPUecPGxb7loOx8knhMHY=; b=XuIjJjn4VuJ5SP/iBwhDk9KS9+n8m7UnZ6SPsj3Aq0aP4SRXOOvoMMlX8/McpFtccW Hhx3jwKgPUzGTTLoTdNMxA+gplleH54Ic8UME0rtYPGTRn15DT4gpYiAjnCuS2cR8dZ0 PPUx7sQa4AmEVPqFBZqJgZ9D05LnjUTgD3YP9jTTEe7Tn+xqeByA0sJXpf1SLZntojiN Sm7YffI9g4Zr8Ly1nvi0oPaEmYWLRe/ubUdKfLEPc0j2xe61qnDS9W1Ez4brkNAR2VYR C0hek0cdPdepM9dJpIy5qpiH8I2CJHNeub9wsV7ks8tmyk7Q1aPEMm1JZmySBuAhWZJl CGKg== X-Gm-Message-State: ALoCoQlskkWyfYoaT2SuTB1oaXMV+esTXvyveC42ZzaQ12I31+fF9nkQ1RQv3sQhxZurqL+mi4M0 X-Received: by 10.15.82.136 with SMTP id a8mr14846108eez.81.1388659686903; Thu, 02 Jan 2014 02:48:06 -0800 (PST) Received: from [10.0.2.117] ([80.82.22.190]) by mx.google.com with ESMTPSA id o1sm134864567eea.10.2014.01.02.02.48.05 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Thu, 02 Jan 2014 02:48:06 -0800 (PST) Message-ID: <52C543E4.7090805@semihalf.com> Date: Thu, 02 Jan 2014 11:48:04 +0100 From: Zbigniew Bodek Organization: Semihalf User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:24.0) Gecko/20100101 Thunderbird/24.2.0 MIME-Version: 1.0 To: Konstantin Belousov , Zbigniew Bodek Subject: Re: svn commit: r260165 - head/sys/dev/ahci References: <201401012026.s01KQ8KU017949@svn.freebsd.org> <20140101203212.GF59496@kib.kiev.ua> In-Reply-To: <20140101203212.GF59496@kib.kiev.ua> X-Enigmail-Version: 1.6 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 02 Jan 2014 10:53:33 -0000 On 01.01.2014 21:32, Konstantin Belousov wrote: > On Wed, Jan 01, 2014 at 08:26:08PM +0000, Zbigniew Bodek wrote: >> Author: zbb Date: Wed Jan 1 20:26:08 2014 New Revision: 260165 >> URL: http://svnweb.freebsd.org/changeset/base/260165 >> >> Log: Use only mapped BIOs on ARM >> >> Using unmapped BIOs causes failure inside bus_dmamap_sync, since >> this function requires valid MVA address, which is not present >> if mapping is not set up. >> >> Submitted by: Wojciech Macek Obtained from: >> Semihalf >> >> Modified: head/sys/dev/ahci/ahci.c >> >> Modified: head/sys/dev/ahci/ahci.c >> ============================================================================== >> >> >> --- head/sys/dev/ahci/ahci.c Wed Jan 1 20:22:29 2014 (r260164) >> +++ head/sys/dev/ahci/ahci.c Wed Jan 1 20:26:08 2014 (r260165) >> @@ -3066,7 +3066,15 @@ ahciaction(struct cam_sim *sim, union cc >> if (ch->caps & AHCI_CAP_SPM) cpi->hba_inquiry |= PI_SATAPM; >> cpi->target_sprt = 0; +#ifdef __arm__ + /* + * Do not use >> unmapped buffers on ARM. Doing so will cause + * failure >> inside bus_dmamap_sync due to lack of VA. + */ + cpi->hba_misc >> = PIM_SEQSCAN; +#else cpi->hba_misc = PIM_SEQSCAN | PIM_UNMAPPED; >> +#endif cpi->hba_eng_cnt = 0; if (ch->caps & AHCI_CAP_SPM) >> cpi->max_target = 15; > > I think this is wrong. If bus_dmamap_sync(9) is not functional on > arm, then unmapped io should be disabled on arm unconditionally, > using unmapped_buf_allowed. Why ahci(4) is special in this > regard, leaving other controllers broken for arm ? > Hello Konstantin. Thanks for pointing that out. You are right, we didn't know about unmapped_buf_allowed flag. bus_dmamap_sync() is functional on ARM however it needs virtual address therefore unmapped_buf_allowed should be set to 0 on ARM (it is set to 1 now). I will revert this commit but we will need some time to test the other solution. Best regards zbb