Received: by 2002:ac0:a5a6:0:0:0:0:0 with SMTP id m35-v6csp36898imm; Wed, 5 Sep 2018 13:17:51 -0700 (PDT) X-Google-Smtp-Source: ANB0VdZZ3mXnVEX+5ENpsR743Sp470rTEXbvRu9e8ve5a9emlBLgMvY5uSuEgA/f47kBzRDd9JYH X-Received: by 2002:a63:ff1f:: with SMTP id k31-v6mr37534564pgi.20.1536178671836; Wed, 05 Sep 2018 13:17:51 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1536178671; cv=none; d=google.com; s=arc-20160816; b=SV2dk0o8cVHNNx2wC3HfjATxTXG6kqgGKlZdA1wCnXKO1j8zqGUc4HsOqSHEdjXAT6 QPkil8E4XcOItH8LXWi3GBBRyFVmRL0QiJ+XQis5NaREZZRwbmadmxzExbkWXaSptXnp PmKpkS1pX0iThwwxJ1Hl8dDt9CqNGWRcyATkvlEgnMEL42/3CSly+p8HW4pA/4F/ZQD2 yD2L/u4coI75Lx1bQXDbardn9+mbdTUElIISvo2c6S8zbRlPVlokG67m0Eyx3cnWkzrI qdIR04mfm8GTGmKgXI2E2865rmGzN7pP4GNhZBiQ58HFj4xSQ/6xoCOuc5f8p++UJOfd RsnA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding :content-language:in-reply-to:mime-version:user-agent:date :message-id:from:references:cc:to:subject; bh=WaO5ifc5QHgBJCGbo28A4GiI6XTbM/o9npOjIdeS+84=; b=OKW2kwtg1cXqUHd4uFbG8HSsCdduHN+kn+MkxazXY/KLPfrXPDn0UWfQGoiAryQF9r sO03KIXoGhXdJXgqDmsdw/8UJZsj7bPbi16xpych/oPXV+IAQKpb3N9KqkADjHdkoVbd HXqNqXND+X0MEMqNihJ5Ir2yLbZlVxSvQXqLwyatkr8FfIctJSF0dJ+Q824t2KT2RZV8 khf7oOQ5M8qEUyRA2ZT7HbbD5i6Vw0KrUWglIFTxHIOP/TgzAx5IWwN/CBH0vnBe4F+2 4tkB346P41coUTk18EgDcQ3vuF6T0901/O3alaKyun8jII9wp6RO6yGynYb8sHvGi7RE WTLg== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=redhat.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id e7-v6si2813322pgc.233.2018.09.05.13.17.36; Wed, 05 Sep 2018 13:17:51 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=redhat.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727972AbeIFArt (ORCPT + 99 others); Wed, 5 Sep 2018 20:47:49 -0400 Received: from mail-wr1-f65.google.com ([209.85.221.65]:44360 "EHLO mail-wr1-f65.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727599AbeIFArs (ORCPT ); Wed, 5 Sep 2018 20:47:48 -0400 Received: by mail-wr1-f65.google.com with SMTP id v16-v6so8935956wro.11 for ; Wed, 05 Sep 2018 13:16:01 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:subject:to:cc:references:from:message-id:date :user-agent:mime-version:in-reply-to:content-language :content-transfer-encoding; bh=WaO5ifc5QHgBJCGbo28A4GiI6XTbM/o9npOjIdeS+84=; b=EXjkRAj/HrT8Z+ymDYAvFKGIZ0vxzoKZP8pB/+Ld2hEOpPCPPu2Piw5zYwkhi7wvQU robB3mJBfGfPOdW7mcx5ynY6RP20cXcwBLC4awR2gzm01ncXElMZDqidKEBzfa+pcIls fTHE8B89hu8jeJTSzee+28KYSag1rgKWdDgLC5BTumxYq5fZaVWo0MkaLOP5xNv4DSiP bd9CA+ykii5CMcUHIb7rvNzDOK7eU4TVbMKrGZrsa5Ty1ktPw7eSL8OO/dqkRhJMG6wO wOH0mww3URg6QF3yeKlzRog1x0/Lp7ljEFgllA/NH569Y1wle2CoImOZOKvmlkJmTwPq n+pQ== X-Gm-Message-State: APzg51D/fy/bk+6YXjw9r2TD8t0shvyJhJogMWABuZ2Q57j9ghK+yWDu IqnPiSShk7zPJhyENIxCc4dlVA== X-Received: by 2002:adf:e30e:: with SMTP id b14-v6mr27442210wrj.158.1536178560718; Wed, 05 Sep 2018 13:16:00 -0700 (PDT) Received: from shalem.localdomain (546A5441.cm-12-3b.dynamic.ziggo.nl. [84.106.84.65]) by smtp.gmail.com with ESMTPSA id o3-v6sm4158213wrn.58.2018.09.05.13.15.59 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 05 Sep 2018 13:16:00 -0700 (PDT) Subject: Re: [PATCH v2] ata: Disable AHCI ALPM feature for Ampere Computing eMAG SATA To: Suman Tripathi , axboe@kernel.dk, tj@kernel.org, linux-ide@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, joe@perches.com, arnd@arndb.de, gregkh@linuxfoundation.org Cc: patches@amperecomputing.com, Rameshwar Prasad Sahu References: <1536178375-31700-1-git-send-email-stripathi@amperecomputing.com> From: Hans de Goede Message-ID: Date: Wed, 5 Sep 2018 22:15:59 +0200 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.8.0 MIME-Version: 1.0 In-Reply-To: <1536178375-31700-1-git-send-email-stripathi@amperecomputing.com> Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-US Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hi, On 05-09-18 22:12, Suman Tripathi wrote: > Due to hardware errata, Ampere Computing eMAG SATA can't support > AHCI ALPM feature. This patch disables the AHCI ALPM feature for > eMAG SATA. > > Changes for v2: > > * Introduce the new ata_port_info object which includes ATA_FLAG_NO_LPM. > * Include this object for eMAG SATA inside the acpi match table. > * Retrieve the ata_port_info from the acpi match table. > > Signed-off-by: Suman Trpathi > Signed-off-by: Rameshwar Prasad Sahu > --- > drivers/ata/ahci_platform.c | 17 +++++++++++++++-- > 1 file changed, 15 insertions(+), 2 deletions(-) > > diff --git a/drivers/ata/ahci_platform.c b/drivers/ata/ahci_platform.c > index 99f9a89..c3043f6 100644 > --- a/drivers/ata/ahci_platform.c > +++ b/drivers/ata/ahci_platform.c > @@ -33,6 +33,13 @@ > .port_ops = &ahci_platform_ops, > }; > > +static const struct ata_port_info ahci_port_info_nolpm = { > + .flags = AHCI_FLAG_COMMON | ATA_FLAG_NO_LPM, > + .pio_mask = ATA_PIO4, > + .udma_mask = ATA_UDMA6, > + .port_ops = &ahci_platform_ops, > +}; > + > static struct scsi_host_template ahci_platform_sht = { > AHCI_SHT(DRV_NAME), > }; > @@ -41,7 +48,8 @@ static int ahci_probe(struct platform_device *pdev) > { > struct device *dev = &pdev->dev; > struct ahci_host_priv *hpriv; > - int rc; > + const struct ata_port_info *port; > + int rc; You are accidentally changing the indentation of rc here. Please fix this and run scripts/checkpatch.pl on the patch before submitting v3. Otherwise v2 looks good. Regards, Hans > > hpriv = ahci_platform_get_resources(pdev); > if (IS_ERR(hpriv)) > @@ -57,7 +65,11 @@ static int ahci_probe(struct platform_device *pdev) > if (of_device_is_compatible(dev->of_node, "hisilicon,hisi-ahci")) > hpriv->flags |= AHCI_HFLAG_NO_FBS | AHCI_HFLAG_NO_NCQ; > > - rc = ahci_platform_init_host(pdev, hpriv, &ahci_port_info, > + port = acpi_device_get_match_data(dev); > + if (!port) > + port = &ahci_port_info; > + > + rc = ahci_platform_init_host(pdev, hpriv, port, > &ahci_platform_sht); > if (rc) > goto disable_resources; > @@ -85,6 +97,7 @@ static SIMPLE_DEV_PM_OPS(ahci_pm_ops, ahci_platform_suspend, > MODULE_DEVICE_TABLE(of, ahci_of_match); > > static const struct acpi_device_id ahci_acpi_match[] = { > + { "APMC0D33", (unsigned long)&ahci_port_info_nolpm }, > { ACPI_DEVICE_CLASS(PCI_CLASS_STORAGE_SATA_AHCI, 0xffffff) }, > {}, > }; >