From owner-freebsd-hackers@freebsd.org Thu Jan 28 17:13:40 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 29E0CA703AD for ; Thu, 28 Jan 2016 17:13:40 +0000 (UTC) (envelope-from ian@freebsd.org) Received: from outbound1b.ore.mailhop.org (outbound1b.ore.mailhop.org [54.200.247.200]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id F32CD1418 for ; Thu, 28 Jan 2016 17:13:39 +0000 (UTC) (envelope-from ian@freebsd.org) Received: from ilsoft.org (unknown [73.34.117.227]) by outbound1.ore.mailhop.org (Halon Mail Gateway) with ESMTPSA; Thu, 28 Jan 2016 17:13:43 +0000 (UTC) Received: from rev (rev [172.22.42.240]) by ilsoft.org (8.15.2/8.14.9) with ESMTP id u0SHDbd9034246; Thu, 28 Jan 2016 10:13:37 -0700 (MST) (envelope-from ian@freebsd.org) Message-ID: <1454001217.1275.19.camel@freebsd.org> Subject: Re: impossible to set pata dma mode? From: Ian Lepore To: Norbert Koch , freebsd-hackers@FreeBSD.org Date: Thu, 28 Jan 2016 10:13:37 -0700 In-Reply-To: <56AA42CF.10408@demig.de> References: <56A9D502.7010809@demig.de> <1453995911.1275.14.camel@freebsd.org> <56AA42CF.10408@demig.de> Content-Type: text/plain; charset="us-ascii" X-Mailer: Evolution 3.16.5 FreeBSD GNOME Team Port Mime-Version: 1.0 Content-Transfer-Encoding: 7bit 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: Thu, 28 Jan 2016 17:13:40 -0000 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 > > 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 > >