From patchwork Tue Jun 23 07:51:23 2009 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Frans Pop X-Patchwork-Id: 29029 X-Patchwork-Delegate: davem@davemloft.net Return-Path: X-Original-To: patchwork-incoming@bilbo.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from ozlabs.org (ozlabs.org [203.10.76.45]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (Client CN "mx.ozlabs.org", Issuer "CA Cert Signing Authority" (verified OK)) by bilbo.ozlabs.org (Postfix) with ESMTPS id DB51BB7118 for ; Tue, 23 Jun 2009 17:52:11 +1000 (EST) Received: by ozlabs.org (Postfix) id CDE9ADDDE1; Tue, 23 Jun 2009 17:52:11 +1000 (EST) Delivered-To: patchwork-incoming@ozlabs.org Received: from vger.kernel.org (vger.kernel.org [209.132.176.167]) by ozlabs.org (Postfix) with ESMTP id 2FC09DDDD4 for ; Tue, 23 Jun 2009 17:52:11 +1000 (EST) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1757408AbZFWHv0 (ORCPT ); Tue, 23 Jun 2009 03:51:26 -0400 Received: (majordomo@vger.kernel.org) by vger.kernel.org id S1752205AbZFWHv0 (ORCPT ); Tue, 23 Jun 2009 03:51:26 -0400 Received: from cpsmtpm-eml102.kpnxchange.com ([195.121.3.6]:63369 "EHLO CPSMTPM-EML102.kpnxchange.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1757408AbZFWHvY (ORCPT ); Tue, 23 Jun 2009 03:51:24 -0400 Received: from aragorn.fjphome.nl ([84.85.147.182]) by CPSMTPM-EML102.kpnxchange.com with Microsoft SMTPSVC(7.0.6001.18000); Tue, 23 Jun 2009 09:51:25 +0200 From: Frans Pop To: Bartlomiej Zolnierkiewicz Subject: [PATCH] ide-cd: Improve "weird block size" error message Date: Tue, 23 Jun 2009 09:51:23 +0200 User-Agent: KMail/1.9.9 Cc: David Miller , sparclinux@vger.kernel.org, linux-ide@vger.kernel.org, linux-kernel@vger.kernel.org References: <200906211446.38598.elendil@planet.nl> <200906222101.38586.elendil@planet.nl> <200906222335.06700.bzolnier@gmail.com> In-Reply-To: <200906222335.06700.bzolnier@gmail.com> MIME-Version: 1.0 Content-Disposition: inline Message-Id: <200906230951.24615.elendil@planet.nl> X-OriginalArrivalTime: 23 Jun 2009 07:51:25.0372 (UTC) FILETIME=[68833FC0:01C9F3D7] Sender: sparclinux-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: sparclinux@vger.kernel.org On Monday 22 June 2009, Bartlomiej Zolnierkiewicz wrote: > On Monday 22 June 2009 21:01:37 Frans Pop wrote: > > There is one thing I should mention here. I have been seeing the > > following error with this CD drive: > > ide-cd: hdd: weird block size 2352 > > ide-cd: hdd: default to 2kb block size > > This is just a harmless warning coming from enabling of the workaround > for weird ATAPI devices (the one you have in this sparc machine seems > to score really high on the weirdness scale ;) introduced by commit > e8e7b9e. In that case I'd like to propose the following patch. Currently the error can get printed much to frequently when there's a disc in the drive. Example: Jun 13 18:06:28 gimli kernel: ide-cd: hdd: weird block size 2352 Jun 13 18:06:28 gimli kernel: ide-cd: hdd: default to 2kb block size Jun 13 18:06:32 gimli kernel: ide-cd: hdd: weird block size 2352 Jun 13 18:06:42 gimli kernel: ide-cd: hdd: default to 2kb block size Jun 13 18:07:02 gimli kernel: ide-cd: hdd: weird block size 2352 Jun 13 18:07:02 gimli kernel: ide-cd: hdd: default to 2kb block size Jun 13 18:07:05 gimli kernel: ide-cd: hdd: weird block size 2352 Jun 13 18:07:05 gimli kernel: ide-cd: hdd: default to 2kb block size Jun 13 18:07:09 gimli kernel: ide-cd: hdd: weird block size 2352 Jun 13 18:07:09 gimli kernel: ide-cd: hdd: default to 2kb block size Jun 13 18:07:14 gimli kernel: ide-cd: hdd: weird block size 2352 Jun 13 18:07:14 gimli kernel: ide-cd: hdd: default to 2kb block size Jun 13 18:07:35 gimli kernel: ide-cd: hdd: weird block size 2352 Jun 13 18:07:35 gimli kernel: ide-cd: hdd: default to 2kb block size Jun 13 18:07:51 gimli kernel: ide-cd: hdd: weird block size 2352 Jun 13 18:07:51 gimli kernel: ide-cd: hdd: default to 2kb block size I was not using the CD at all here. I suspect HAL's stupid polling to be the culprit as I first saw it after upgrading X.Org packages to a version which depends on HAL. I since disabled polling for the device, but I still feel that warning once should be sufficient as IIUC the value is device dependent and not medium dependent. With the patch it only gets printed once, when the driver is initialized. Cheers, FJP Acked-by: Borislav Petkov --- From: Frans Pop Subject: ide-cd: Improve "weird block size" error message Currently the error gets repeated too frequently, for example each time HAL polls the device when a disc is present. Avoid that by using printk_once instead of printk. Also join the error and corrective action messages into a single line. Signed-off-by: Frans Pop Cc: Bartlomiej Zolnierkiewicz -- To unsubscribe from this list: send the line "unsubscribe sparclinux" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html diff --git a/drivers/ide/ide-cd.c b/drivers/ide/ide-cd.c index 4a19686..7ec6996 100644 --- a/drivers/ide/ide-cd.c +++ b/drivers/ide/ide-cd.c @@ -886,10 +886,9 @@ static int cdrom_read_capacity(ide_drive_t *drive, unsigned long *capacity, case 4096: break; default: - printk(KERN_ERR PFX "%s: weird block size %u\n", + printk_once(KERN_ERR PFX "%s: weird block size %u; " + "setting default block size to 2048\n", drive->name, blocklen); - printk(KERN_ERR PFX "%s: default to 2kb block size\n", - drive->name); blocklen = 2048; break; }