From patchwork Wed Jun 15 19:17:47 2011 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Nishanth Aravamudan X-Patchwork-Id: 100567 X-Patchwork-Delegate: davem@davemloft.net Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by ozlabs.org (Postfix) with ESMTP id 1147FB6FDA for ; Thu, 16 Jun 2011 05:18:22 +1000 (EST) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753603Ab1FOTSU (ORCPT ); Wed, 15 Jun 2011 15:18:20 -0400 Received: from e34.co.us.ibm.com ([32.97.110.152]:54397 "EHLO e34.co.us.ibm.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753503Ab1FOTST (ORCPT ); Wed, 15 Jun 2011 15:18:19 -0400 Received: from d03relay03.boulder.ibm.com (d03relay03.boulder.ibm.com [9.17.195.228]) by e34.co.us.ibm.com (8.14.4/8.13.1) with ESMTP id p5FJ5RcY031988; Wed, 15 Jun 2011 13:05:27 -0600 Received: from d03av04.boulder.ibm.com (d03av04.boulder.ibm.com [9.17.195.170]) by d03relay03.boulder.ibm.com (8.13.8/8.13.8/NCO v10.0) with ESMTP id p5FJHuWf177060; Wed, 15 Jun 2011 13:17:56 -0600 Received: from d03av04.boulder.ibm.com (loopback [127.0.0.1]) by d03av04.boulder.ibm.com (8.14.4/8.13.1/NCO v10.0 AVout) with ESMTP id p5FDHtwj027335; Wed, 15 Jun 2011 07:17:56 -0600 Received: from arkanoid.localdomain (sig-9-65-245-240.mts.ibm.com [9.65.245.240]) by d03av04.boulder.ibm.com (8.14.4/8.13.1/NCO v10.0 AVin) with ESMTP id p5FDHqlc027206; Wed, 15 Jun 2011 07:17:54 -0600 Received: by arkanoid.localdomain (Postfix, from userid 1000) id C138BF3133; Wed, 15 Jun 2011 12:17:47 -0700 (PDT) Date: Wed, 15 Jun 2011 12:17:47 -0700 From: Nishanth Aravamudan To: jgarzik@pobox.com Cc: mbizon@freebox.fr, tj@kernel.org, benh@kernel.crashing.org, wayneb@linux.vnet.ibm.com, linuxppc-dev@lists.ozlabs.org, linux-ide@vger.kernel.org, linux-kernel@vger.kernel.org Subject: libata/ipr/powerpc: regression between 2.6.39-rc4 and 2.6.39-rc5 Message-ID: <20110615191747.GA6324@us.ibm.com> MIME-Version: 1.0 Content-Disposition: inline X-Operating-System: Linux 2.6.38-8-generic (x86_64) User-Agent: Mutt/1.5.21 (2010-09-15) Sender: linux-ide-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-ide@vger.kernel.org Hi Jeff, It appears that commit 7b3a24c57d2eeda8dba9c205342b12689c4679f9 broke CD-ROMs on the IPR SATA bus on powerpc machines: ata_port_alloc: ENTER ata_port_probe: ata1: bus probe begin ata1.00: ata_dev_read_id: ENTER ata1.00: failed to IDENTIFY (I/O error, err_mask=0x40) ata1.00: ata_dev_read_id: ENTER ata1.00: failed to IDENTIFY (I/O error, err_mask=0x40) ata1.00: limiting speed to UDMA7:PIO5 ata1.00: ata_dev_read_id: ENTER ata1.00: failed to IDENTIFY (I/O error, err_mask=0x40) ata1.00: disabled ata_port_probe: ata1: bus probe end scsi_alloc_sdev: Allocation failure during SCSI scanning, some SCSI devices might not be configured The commit in question is tagged as AHCI, but does touch the libata core. I'm not well-versed with this code, but here's what I think I know :) From __scsi_add_device, we first allocate the target: scsi_alloc_target -> shost->hostt->target_alloc -> ipr_target_alloc -> ata_port_alloc -> sets FROZEN We error out when we allocate the sdev: scsi_alloc_sdev -> shost->hostt->slave_alloc -> ipr_slave_alloc -> ipr_ata_slave_alloc -> ata_sas_port_init -> ata_port_probe From what I can tell, the only place that explicitly clears the FROZEN flag is the error-handling code via ata_eh_thaw_port(). So I thought either we're not invoking the error-handler at probe time correctly to kick the port or perhaps the SAS code is not clearing the flag? I tried the following patch: and the CD-ROM drive works, but I have no idea if it's the right thing to do. I chose this particular change, FWIW, because we call ata_sas_port_start before we probe in ata_sas_port_init and it seems like we need to mark the port as not frozen before we init it? Perhaps that should really be a call to a thaw function, not sure. Let's just say the ATA/SAS/SCSI interactions are a bit hard to follow at first :) Any insight you can provide would be great! Thanks, Nish diff --git a/drivers/ata/libata-scsi.c b/drivers/ata/libata-scsi.c index d51f979..abd0e0b 100644 --- a/drivers/ata/libata-scsi.c +++ b/drivers/ata/libata-scsi.c @@ -3797,6 +3797,7 @@ EXPORT_SYMBOL_GPL(ata_sas_port_alloc); */ int ata_sas_port_start(struct ata_port *ap) { + ap->pflags &= ~ATA_PFLAG_FROZEN; return 0; } EXPORT_SYMBOL_GPL(ata_sas_port_start);