From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from out-178.mta1.migadu.com (out-178.mta1.migadu.com [95.215.58.178]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 8C4A6326D51 for ; Thu, 4 Jun 2026 15:23:46 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=95.215.58.178 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1780586628; cv=none; b=RXke+lOeTBSYORTNKRGoDsPWDWzvgGsUudFmwNvWG2VncCFbdj8JCfwWK/IJAWrTeFkJnjGGj1ma621Icuk78Y89Af5PfU7j3dZCklNDp2OQGKWQLle9n0K9Rhfl1s8CBry3WqXcVSKVGM0rGqP524kFY0EVaAsfYbD7vTN9E5k= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1780586628; c=relaxed/simple; bh=bkB44YU6QH304DRxGAWjSMyjX9K5VK5tzw/kXsbC3IE=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=AFXEP3dX5/ukfJEZsGaXDdUNlBOzygJsg+dIyyY902m+rcIu00gbDL37F8HvouPLP+M8x/46z4QR3DzvugBmwbOkxmNb5/+rQsRScaq7cHupHAhBKGI3+UHDgESF1mvGsGoiaQRmDJt3Ucl0WeeFAqmldYgfBVawcxIjPxc4FEI= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linux.dev; spf=pass smtp.mailfrom=linux.dev; dkim=pass (1024-bit key) header.d=linux.dev header.i=@linux.dev header.b=S4wQytFx; arc=none smtp.client-ip=95.215.58.178 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linux.dev Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=linux.dev Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linux.dev header.i=@linux.dev header.b="S4wQytFx" Date: Thu, 4 Jun 2026 17:23:41 +0200 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linux.dev; s=key1; t=1780586624; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=BkzA74NEh+1zWzq6Zo2oPB3b8kP5iWLEY2RRF2oveVc=; b=S4wQytFx7TYb2EY+D2apXyp0WDo6wPmIwAthpByHiLwkx+AXyI5QMyvXG280eFdFNIfYa6 X/ilB4OcCpQDKNoozUX8BeryaDij8mPZd54ZEZJ6pVBOeNgYglaTArSzhGcGCPKlpdbCfW QpffrJZ3PmeruSbUScxcZP8WdPOa2Fs= X-Report-Abuse: Please report any abuse attempt to abuse@migadu.com and include these headers. From: Thorsten Blum To: Thomas Gleixner , Ingo Molnar , Borislav Petkov , Dave Hansen , x86@kernel.org, "H. Peter Anvin" Cc: linux-kernel@vger.kernel.org Subject: Re: [PATCH v2] x86/boot: use BASE_BAUD and DEFAULT_SERIAL_PORT Message-ID: References: <20260515111040.536150-3-thorsten.blum@linux.dev> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20260515111040.536150-3-thorsten.blum@linux.dev> X-Migadu-Flow: FLOW_OUT Gentle ping? On Fri, May 15, 2026 at 01:10:40PM +0200, Thorsten Blum wrote: > Replace the hard-coded divisor and ttyS0 port with the existing > BASE_BAUD and DEFAULT_SERIAL_PORT macros. > > In parse_earlyprintk(), assign port directly and drop the redundant > index variable as well as the bases array to simplify the code. > > Signed-off-by: Thorsten Blum > --- > Changes in v2: > - Drop patch 1/2 from the series after feedback from Dave > - v1: https://lore.kernel.org/lkml/20260411153449.69384-4-thorsten.blum@linux.dev/ > --- > arch/x86/boot/early_serial_console.c | 13 +++++-------- > 1 file changed, 5 insertions(+), 8 deletions(-) > > diff --git a/arch/x86/boot/early_serial_console.c b/arch/x86/boot/early_serial_console.c > index 023bf1c3de8b..caf481cdd415 100644 > --- a/arch/x86/boot/early_serial_console.c > +++ b/arch/x86/boot/early_serial_console.c > @@ -22,6 +22,7 @@ > #define DLH 1 /* Divisor latch High */ > > #define DEFAULT_BAUD 9600 > +#define BASE_BAUD (1843200/16) > > static void early_serial_init(int port, int baud) > { > @@ -33,7 +34,7 @@ static void early_serial_init(int port, int baud) > outb(0, port + FCR); /* no fifo */ > outb(0x3, port + MCR); /* DTR + RTS */ > > - divisor = 115200 / baud; > + divisor = BASE_BAUD / baud; > c = inb(port + LCR); > outb(c | DLAB, port + LCR); > outb(divisor & 0xff, port + DLL); > @@ -74,16 +75,13 @@ static void parse_earlyprintk(void) > else > pos = e - arg; > } else if (!strncmp(arg + pos, "ttyS", 4)) { > - static const int bases[] = { 0x3f8, 0x2f8 }; > - int idx = 0; > - > /* += strlen("ttyS"); */ > pos += 4; > > if (arg[pos++] == '1') > - idx = 1; > - > - port = bases[idx]; > + port = 0x2f8; /* ttyS1 */ > + else > + port = DEFAULT_SERIAL_PORT; > } > > if (arg[pos] == ',') > @@ -98,7 +96,6 @@ static void parse_earlyprintk(void) > early_serial_init(port, baud); > } > > -#define BASE_BAUD (1843200/16) > static unsigned int probe_baud(int port) > { > unsigned char lcr, dll, dlh;