From owner-freebsd-hackers@freebsd.org Fri Jan 29 07:45:24 2016 Return-Path: Delivered-To: freebsd-hackers@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 4A617A71D4C for ; Fri, 29 Jan 2016 07:45:24 +0000 (UTC) (envelope-from nkoch@demig.de) Received: from demig.de (demig.de [81.169.228.196]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "Parallels Panel", Issuer "Parallels Panel" (not verified)) by mx1.freebsd.org (Postfix) with ESMTPS id A5DCA1A53 for ; Fri, 29 Jan 2016 07:45:23 +0000 (UTC) (envelope-from nkoch@demig.de) Received: (qmail 17048 invoked from network); 29 Jan 2016 08:44:19 +0100 Received: from b2b-130-180-89-86.unitymedia.biz (HELO firewall.demig.intra) (130.180.89.86) by demig.de with ESMTPSA (DHE-RSA-AES256-SHA encrypted, authenticated); 29 Jan 2016 08:44:19 +0100 Received: from SRV-FS-2.Demig.intra (nameserver.demig.intra [192.168.148.248]) by firewall.demig.intra (8.14.4/8.14.4) with ESMTP id u0T7hnat039455 for ; Fri, 29 Jan 2016 08:43:49 +0100 (CET) (envelope-from nkoch@demig.de) Received: from [192.168.148.83] (192.168.148.83) by SRV-FS-2 (192.168.148.248) with Microsoft SMTP Server (TLS) id 14.3.123.3; Fri, 29 Jan 2016 08:43:46 +0100 Subject: Re: impossible to set pata dma mode? To: References: <56A9D502.7010809@demig.de> <1453995911.1275.14.camel@freebsd.org> <56AA42CF.10408@demig.de> <1454001217.1275.19.camel@freebsd.org> From: Norbert Koch X-Enigmail-Draft-Status: N1110 Message-ID: <56AB1831.2070907@demig.de> Date: Fri, 29 Jan 2016 08:43:45 +0100 User-Agent: Mozilla/5.0 (Windows NT 5.1; rv:38.0) Gecko/20100101 Thunderbird/38.5.1 MIME-Version: 1.0 In-Reply-To: <1454001217.1275.19.camel@freebsd.org> Content-Type: text/plain; charset="windows-1252" Content-Transfer-Encoding: 7bit X-Scanned-By: MIMEDefang 2.73 on 192.168.148.235 X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 29 Jan 2016 07:45:24 -0000 Am 28.01.2016 um 18:13 schrieb Ian Lepore: > On Thu, 2016-01-28 at 17:33 +0100, Norbert Koch wrote: >> Am 28.01.2016 um 16:45 schrieb Ian Lepore: >> >> >> Thanks Ian, I know that I can configure this using >> boot hints. >> >> I am having a rather special situation where I need to >> change these settings after boot. It has to do with >> pxe booting different FreeBSD versions using an >> outdated grub which only allows to directly load >> a kernel without specifying boot parameters. >> >> Obviously I can help myself with a modified >> camcontrol. But I am still curious what the >> reason for the limitation might be. >> >> > I'll have to leave the cam-related questions for the cam gurus. > > Do you have a custom kernel for these systems? If so, you can > configure tunables by compiling a static environment into the kernel > using the 'env' argument described in config(5). I recently committed > changes that fix the env directive so that it works on all > architectures now. Still maybe not what you need, but worth > mentioning. > > -- Ian Yes, you are right. I could build a custom kernel with "hints my.hints" or "env my.env", having a line hint.ata.0.mode="WDMA2". Thanks. > >>> On Thu, 2016-01-28 at 09:44 +0100, Norbert Koch wrote: >>>> Hello. >>>> >>>> I have to reduce dma mode from udma to wdma2 >>>> for a flash device. >>>> >>>> In the past this was easy using atacontrol >>>> but, afaiks it seems to be impossible using camcontrol. >>>> >>>> camcontrol negotiate ada0 -M wdma >>>> ...You can only modify user parameters >>>> >>>> camcontrol negotiate ada0 -NM wdma >>>> Works, but I see no way how those user >>>> parameters become active parameters as the >>>> driver only reads then in attach as far as >>>> I can see. >>>> >>>> It seems like the ata driver's interface >>>> allows to change the current settings >>>> (XPT_SET_TRAN_SETTINGS/CTS_TYPE_CURRENT_SETTINGS) >>>> so, why is camcontrol so restrictive? >>>> >>>> Thank you, >>>> Norbert Koch >>> I don't know about changing it on the fly with camcontrol (I've >>> never >>> done that), but you can configure it at boot time with a tunable in >>> loader.conf of the form >>> >>> dev.ada.0.mode="modestr" >>> >>> Where modestr is one of these (from dev/ata/ata-all.c): >>> >>> if (!strcasecmp(str, "PIO0")) return (ATA_PIO0); >>> if (!strcasecmp(str, "PIO1")) return (ATA_PIO1); >>> if (!strcasecmp(str, "PIO2")) return (ATA_PIO2); >>> if (!strcasecmp(str, "PIO3")) return (ATA_PIO3); >>> if (!strcasecmp(str, "PIO4")) return (ATA_PIO4); >>> if (!strcasecmp(str, "WDMA0")) return (ATA_WDMA0); >>> if (!strcasecmp(str, "WDMA1")) return (ATA_WDMA1); >>> if (!strcasecmp(str, "WDMA2")) return (ATA_WDMA2); >>> if (!strcasecmp(str, "UDMA0")) return (ATA_UDMA0); >>> if (!strcasecmp(str, "UDMA16")) return (ATA_UDMA0); >>> if (!strcasecmp(str, "UDMA1")) return (ATA_UDMA1); >>> if (!strcasecmp(str, "UDMA25")) return (ATA_UDMA1); >>> if (!strcasecmp(str, "UDMA2")) return (ATA_UDMA2); >>> if (!strcasecmp(str, "UDMA33")) return (ATA_UDMA2); >>> if (!strcasecmp(str, "UDMA3")) return (ATA_UDMA3); >>> if (!strcasecmp(str, "UDMA44")) return (ATA_UDMA3); >>> if (!strcasecmp(str, "UDMA4")) return (ATA_UDMA4); >>> if (!strcasecmp(str, "UDMA66")) return (ATA_UDMA4); >>> if (!strcasecmp(str, "UDMA5")) return (ATA_UDMA5); >>> if (!strcasecmp(str, "UDMA100")) return (ATA_UDMA5); >>> if (!strcasecmp(str, "UDMA6")) return (ATA_UDMA6); >>> if (!strcasecmp(str, "UDMA133")) return (ATA_UDMA6); >>> >>> -- Ian >> -- Dipl.-Ing. Norbert Koch Entwicklung Prozessregler