Projectname large_stringclasses 15
values | Filepath large_stringlengths 4 106 ⌀ | Function large_stringlengths 11 3.45k | Label list |
|---|---|---|---|
Linux Kernel | drivers/ata/sata_fsl.c |
static ssize_t fsl_sata_rx_watermark_store(struct device *dev,
struct device_attribute *attr,
const char *buf, size_t count) {
unsigned int rx_watermark;
unsigned long flags;
struct ata_host *host = dev_get_drvdata(dev);
stru... | [
1,
0
] |
Linux Kernel | drivers/ata/sata_fsl.c | static enum ata_completion_errors sata_fsl_qc_prep(struct ata_queued_cmd *qc) {
struct ata_port *ap = qc->ap;
struct sata_fsl_port_priv *pp = ap->private_data;
struct sata_fsl_host_priv *host_priv = ap->host->private_data;
void __iomem *hcr_base = host_priv->hcr_base;
unsigned int tag = sata_fsl_tag(ap, qc->h... | [
1,
0
] |
Linux Kernel | drivers/ata/sata_fsl.c |
static bool sata_fsl_qc_fill_rtf(struct ata_queued_cmd *qc) {
struct sata_fsl_port_priv *pp = qc->ap->private_data;
struct sata_fsl_host_priv *host_priv = qc->ap->host->private_data;
void __iomem *hcr_base = host_priv->hcr_base;
unsigned int tag = sata_fsl_tag(qc->ap, qc->hw_tag, hcr_base);
struct command_de... | [
1,
0
] |
Linux Kernel | drivers/ata/sata_fsl.c | static void sata_fsl_port_stop(struct ata_port *ap) {
struct device *dev = ap->host->dev;
struct sata_fsl_port_priv *pp = ap->private_data;
struct sata_fsl_host_priv *host_priv = ap->host->private_data;
void __iomem *hcr_base = host_priv->hcr_base;
u32 temp;
temp = ioread32(hcr_base + HCONTROL);
temp &= ... | [
1,
0
] |
Linux Kernel | drivers/ata/sata_fsl.c |
static void sata_fsl_error_handler(struct ata_port *ap) {
sata_pmp_error_handler(ap);
} | [
0,
0
] |
Linux Kernel | drivers/ata/sata_fsl.c | static void sata_fsl_post_internal_cmd(struct ata_queued_cmd *qc) {
if (qc->flags & ATA_QCFLAG_FAILED)
qc->err_mask |= AC_ERR_OTHER;
if (qc->err_mask) {
}
} | [
0,
0
] |
Linux Kernel | drivers/ata/sata_fsl.c |
static int sata_fsl_remove(struct platform_device *ofdev) {
struct ata_host *host = platform_get_drvdata(ofdev);
struct sata_fsl_host_priv *host_priv = host->private_data;
device_remove_file(&ofdev->dev, &host_priv->intr_coalescing);
device_remove_file(&ofdev->dev, &host_priv->rx_watermark);
ata_host_detac... | [
0,
0
] |
Linux Kernel | drivers/ata/sata_gemini.c |
struct sata_gemini *gemini_sata_bridge_get(void) {
if (sg_singleton)
return sg_singleton;
return ERR_PTR(-EPROBE_DEFER);
} | [
0,
0
] |
Linux Kernel | drivers/ata/sata_gemini.c | bool gemini_sata_bridge_enabled(struct sata_gemini *sg, bool is_ata1) {
if (!sg->sata_bridge)
return false;
if ((sg->muxmode == GEMINI_MUXMODE_2) && !is_ata1)
return false;
if ((sg->muxmode == GEMINI_MUXMODE_3) && is_ata1)
return false;
return true;
} | [
0,
0
] |
Linux Kernel | drivers/ata/sata_highbank.c | static void ecx_led_cycle_clock(struct ecx_plat_data *pdata) {
gpiod_set_value(pdata->sgpio_gpiod[SCLOCK], 1);
udelay(50);
gpiod_set_value(pdata->sgpio_gpiod[SCLOCK], 0);
udelay(50);
} | [
0,
0
] |
Linux Kernel | drivers/ata/sata_highbank.c | static ssize_t ecx_transmit_led_message(struct ata_port *ap, u32 state,
ssize_t size) {
struct ahci_host_priv *hpriv = ap->host->private_data;
struct ecx_plat_data *pdata = hpriv->plat_data;
struct ahci_port_priv *pp = ap->private_data;
unsigned long flags;
int pmp, i;
... | [
1,
0
] |
Linux Kernel | drivers/ata/sata_highbank.c | static void highbank_set_em_messages(struct device *dev,
struct ahci_host_priv *hpriv,
struct ata_port_info *pi) {
struct device_node *np = dev->of_node;
struct ecx_plat_data *pdata = hpriv->plat_data;
int i;
for (i = 0; i < SGPIO_PINS; ... | [
0,
0
] |
Linux Kernel | drivers/ata/sata_highbank.c |
static void cphy_override_rx_mode(u8 sata_port, u32 val) {
u8 lane = port_data[sata_port].lane_mapping;
u32 tmp;
tmp = combo_phy_read(sata_port, CPHY_RX_INPUT_STS + lane * SPHY_LANE);
tmp &= ~CPHY_SATA_RX_OVERRIDE;
combo_phy_write(sata_port, CPHY_RX_OVERRIDE + lane * SPHY_LANE, tmp);
tmp |= CPHY_SATA_RX_O... | [
0,
0
] |
Linux Kernel | drivers/ata/sata_highbank.c |
static int ahci_highbank_resume(struct device *dev) {
struct ata_host *host = dev_get_drvdata(dev);
int rc;
if (dev->power.power_state.event == PM_EVENT_SUSPEND) {
rc = ahci_reset_controller(host);
if (rc)
return rc;
ahci_init_controller(host);
}
ata_host_resume(host);
return 0;
} | [
0,
0
] |
Linux Kernel | drivers/ata/sata_inic162x.c |
static void __iomem *inic_port_base(struct ata_port *ap) {
struct inic_host_priv *hpriv = ap->host->private_data;
return hpriv->mmio_base + ap->port_no * PORT_SIZE;
} | [
1,
0
] |
Linux Kernel | drivers/ata/sata_inic162x.c |
static int inic_scr_write(struct ata_link *link, unsigned sc_reg, u32 val) {
void __iomem *scr_addr = inic_port_base(link->ap) + PORT_SCR;
if (unlikely(sc_reg >= ARRAY_SIZE(scr_map)))
return -EINVAL;
writel(val, scr_addr + scr_map[sc_reg] * 4);
return 0;
} | [
0,
0
] |
Linux Kernel | drivers/ata/sata_inic162x.c |
static void inic_host_err_intr(struct ata_port *ap, u8 irq_stat,
u16 idma_stat) {
struct ata_eh_info *ehi = &ap->link.eh_info;
struct inic_port_priv *pp = ap->private_data;
struct inic_cpb *cpb = &pp->pkt->cpb;
bool freeze = false;
ata_ehi_clear_desc(ehi);
ata_ehi_push_desc(... | [
0,
0
] |
Linux Kernel | drivers/ata/sata_inic162x.c |
static void inic_thaw(struct ata_port *ap) {
void __iomem *port_base = inic_port_base(ap);
writeb(0xff, port_base + PORT_IRQ_STAT);
writeb(PIRQ_MASK_DEFAULT, port_base + PORT_IRQ_MASK);
} | [
0,
0
] |
Linux Kernel | drivers/ata/sata_inic162x.c | static void inic_post_internal_cmd(struct ata_queued_cmd *qc) {
if (qc->flags & ATA_QCFLAG_FAILED)
inic_reset_port(inic_port_base(qc->ap));
} | [
0,
0
] |
Linux Kernel | drivers/ata/sata_inic162x.c | static void init_port(struct ata_port *ap) {
void __iomem *port_base = inic_port_base(ap);
struct inic_port_priv *pp = ap->private_data;
memset(pp->pkt, 0, sizeof(struct inic_pkt));
memset(pp->cpb_tbl, 0, IDMA_CPB_TBL_SIZE);
/* setup CPB lookup table addresses */
writel(pp->cpb_tbl_dma, port_base + PORT_C... | [
1,
0
] |
Linux Kernel | drivers/ata/sata_inic162x.c |
static int inic_port_resume(struct ata_port *ap) {
init_port(ap);
return 0;
} | [
0,
0
] |
Linux Kernel | drivers/ata/sata_mv.c |
static inline void __iomem *mv_hc_base(void __iomem *base, unsigned int hc) {
return (base + SATAHC0_REG_BASE + (hc * MV_SATAHC_REG_SZ));
} | [
0,
0
] |
Linux Kernel | drivers/ata/sata_mv.c |
static inline void __iomem *mv_hc_base_from_port(void __iomem *base,
unsigned int port) {
return mv_hc_base(base, mv_hc_from_port(port));
} | [
0,
0
] |
Linux Kernel | drivers/ata/sata_mv.c |
static inline void __iomem *mv_port_base(void __iomem *base,
unsigned int port) {
return mv_hc_base_from_port(base, port) + MV_SATAHC_ARBTR_REG_SZ +
(mv_hardport_from_port(port) * MV_PORT_REG_SZ);
} | [
0,
0
] |
Linux Kernel | drivers/ata/sata_mv.c | static inline void mv_write_cached_reg(void __iomem *addr, u32 *old, u32 new) {
if (new != *old) {
unsigned long laddr;
*old = new;
laddr = (unsigned long)addr & 0xffff;
if (laddr >= 0x300 && laddr <= 0x33c) {
laddr &= 0x000f;
if (laddr == 0x4 || laddr == 0xc) {
writelfl(new, addr... | [
1,
0
] |
Linux Kernel | drivers/ata/sata_mv.c |
static void mv_enable_port_irqs(struct ata_port *ap, unsigned int port_bits) {
unsigned int shift, hardport, port = ap->port_no;
u32 disable_bits, enable_bits;
MV_PORT_TO_SHIFT_AND_HARDPORT(port, shift, hardport);
disable_bits = (DONE_IRQ | ERR_IRQ) << shift;
enable_bits = port_bits << shift;
mv_set_main... | [
1,
0
] |
Linux Kernel | drivers/ata/sata_mv.c | static void mv_clear_and_enable_port_irqs(struct ata_port *ap,
void __iomem *port_mmio,
unsigned int port_irqs) {
struct mv_host_priv *hpriv = ap->host->private_data;
int hardport = mv_hardport_from_port(ap->port_no);
void __iomem... | [
1,
0
] |
Linux Kernel | drivers/ata/sata_mv.c | static unsigned int mv_scr_offset(unsigned int sc_reg_in) {
unsigned int ofs;
switch (sc_reg_in) {
case SCR_STATUS:
case SCR_CONTROL:
case SCR_ERROR:
ofs = SATA_STATUS + (sc_reg_in * sizeof(u32));
break;
case SCR_ACTIVE:
ofs = SATA_ACTIVE;
break;
default:
ofs = 0xffffffffU;
break;... | [
1,
0
] |
Linux Kernel | drivers/ata/sata_mv.c | static int mv_qc_defer(struct ata_queued_cmd *qc) {
struct ata_link *link = qc->dev->link;
struct ata_port *ap = link->ap;
struct mv_port_priv *pp = ap->private_data;
if (pp->pp_flags & MV_PP_FLAG_DELAYED_EH)
return ATA_DEFER_PORT;
/* PIO commands need exclusive link: no other commands [DMA or PIO]
*... | [
1,
0
] |
Linux Kernel | drivers/ata/sata_mv.c | static void mv_60x1_errata_sata25(struct ata_port *ap, int want_ncq) {
struct mv_host_priv *hpriv = ap->host->private_data;
u32 old, new;
old = readl(hpriv->base + GPIO_PORT_CTL);
if (want_ncq)
new = old | (1 << 22);
else
new = old & ~(1 << 22);
if (new != old)
writel(new, hpriv->base + GPIO_PO... | [
1,
0
] |
Linux Kernel | drivers/ata/sata_mv.c | static void mv_bmdma_enable_iie(struct ata_port *ap, int enable_bmdma) {
struct mv_port_priv *pp = ap->private_data;
u32 new, *old = &pp->cached.unknown_rsvd;
if (enable_bmdma)
new = *old | 1;
else
new = *old & ~1;
mv_write_cached_reg(mv_ap_base(ap) + EDMA_UNKNOWN_RSVD, old, new);
} | [
0,
0
] |
Linux Kernel | drivers/ata/sata_mv.c | static void mv_port_free_dma_mem(struct ata_port *ap) {
struct mv_host_priv *hpriv = ap->host->private_data;
struct mv_port_priv *pp = ap->private_data;
int tag;
if (pp->crqb) {
dma_pool_free(hpriv->crqb_pool, pp->crqb, pp->crqb_dma);
pp->crqb = NULL;
}
if (pp->crpb) {
dma_pool_free(hpriv->crpb... | [
1,
0
] |
Linux Kernel | drivers/ata/sata_mv.c | static void mv_fill_sg(struct ata_queued_cmd *qc) {
struct mv_port_priv *pp = qc->ap->private_data;
struct scatterlist *sg;
struct mv_sg *mv_sg, *last_sg = NULL;
unsigned int si;
mv_sg = pp->sg_tbl[qc->hw_tag];
for_each_sg(qc->sg, sg, qc->n_elem, si) {
dma_addr_t addr = sg_dma_address(sg);
u32 sg_l... | [
1,
0
] |
Linux Kernel | drivers/ata/sata_mv.c | static void mv_bmdma_stop_ap(struct ata_port *ap) {
void __iomem *port_mmio = mv_ap_base(ap);
u32 cmd;
cmd = readl(port_mmio + BMDMA_CMD);
if (cmd & ATA_DMA_START) {
cmd &= ~ATA_DMA_START;
writelfl(cmd, port_mmio + BMDMA_CMD);
/* one-PIO-cycle guaranteed wait, per spec, for HDMA1:0 transition */
... | [
0,
0
] |
Linux Kernel | drivers/ata/sata_mv.c | static unsigned int mv_qc_issue_fis(struct ata_queued_cmd *qc) {
struct ata_port *ap = qc->ap;
struct mv_port_priv *pp = ap->private_data;
struct ata_link *link = qc->dev->link;
u32 fis[5];
int err = 0;
ata_tf_to_fis(&qc->tf, link->pmp, 1, (void *)fis);
err = mv_send_fis(ap, fis, ARRAY_SIZE(fis));
if (... | [
1,
0
] |
Linux Kernel | drivers/ata/sata_mv.c | static void mv_pmp_error_handler(struct ata_port *ap) {
unsigned int pmp, pmp_map;
struct mv_port_priv *pp = ap->private_data;
if (pp->pp_flags & MV_PP_FLAG_DELAYED_EH) {
pmp_map = pp->delayed_eh_pmp_map;
pp->pp_flags &= ~MV_PP_FLAG_DELAYED_EH;
for (pmp = 0; pmp_map != 0; pmp++) {
unsigned int... | [
1,
0
] |
Linux Kernel | drivers/ata/sata_mv.c | static void mv_pmp_eh_prep(struct ata_port *ap, unsigned int pmp_map) {
unsigned int pmp;
for (pmp = 0; pmp_map != 0; pmp++) {
unsigned int this_pmp = (1 << pmp);
if (pmp_map & this_pmp) {
struct ata_link *link = &ap->pmp_link[pmp];
struct ata_eh_info *ehi = &link->eh_info;
pmp_map &= ~t... | [
1,
0
] |
Linux Kernel | drivers/ata/sata_mv.c | static int mv_handle_fbs_non_ncq_dev_err(struct ata_port *ap) {
return 0; /* not handled */
} | [
0,
0
] |
Linux Kernel | drivers/ata/sata_mv.c |
static void mv5_reset_bus(struct ata_host *host, void __iomem *mmio) {
struct pci_dev *pdev = to_pci_dev(host->dev);
int early_5080;
early_5080 = (pdev->device == 0x5080) && (pdev->revision == 0);
if (!early_5080) {
u32 tmp = readl(mmio + MV_PCI_EXP_ROM_BAR_CTL);
tmp |= (1 << 0);
writel(tmp, mmio... | [
0,
0
] |
Linux Kernel | drivers/ata/sata_mv.c | static void mv5_read_preamp(struct mv_host_priv *hpriv, int idx,
void __iomem *mmio) {
void __iomem *phy_mmio = mv5_phy_base(mmio, idx);
u32 tmp;
tmp = readl(phy_mmio + MV5_PHY_MODE);
hpriv->signal[idx].pre = tmp & 0x1800;
hpriv->signal[idx].amps = tmp & 0xe0; /* bits 7:5 */
} | [
1,
0
] |
Linux Kernel | drivers/ata/sata_mv.c |
static void mv5_phy_errata(struct mv_host_priv *hpriv, void __iomem *mmio,
unsigned int port) {
void __iomem *phy_mmio = mv5_phy_base(mmio, port);
const u32 mask = (1 << 12) | (1 << 11) | (1 << 7) | (1 << 6) | (1 << 5);
u32 tmp;
int fix_apm_sq = (hpriv->hp_flags & MV_HP_ERRATA_50XXB0... | [
1,
0
] |
Linux Kernel | drivers/ata/sata_mv.c |
static int mv5_reset_hc(struct ata_host *host, void __iomem *mmio,
unsigned int n_hc) {
struct mv_host_priv *hpriv = host->private_data;
unsigned int hc, port;
for (hc = 0; hc < n_hc; hc++) {
for (port = 0; port < MV_PORTS_PER_HC; port++)
mv5_reset_hc_port(hpriv, mmio, (hc * MV... | [
0,
0
] |
Linux Kernel | drivers/ata/sata_mv.c | static void mv_reset_pci_bus(struct ata_host *host, void __iomem *mmio) {
struct mv_host_priv *hpriv = host->private_data;
u32 tmp;
tmp = readl(mmio + MV_PCI_MODE);
tmp &= 0xff00ffff;
writel(tmp, mmio + MV_PCI_MODE);
ZERO(MV_PCI_DISC_TIMER);
ZERO(MV_PCI_MSI_TRIGGER);
writel(0x000100ff, mmio + MV_PCI_X... | [
1,
0
] |
Linux Kernel | drivers/ata/sata_mv.c | static void mv6_read_preamp(struct mv_host_priv *hpriv, int idx,
void __iomem *mmio) {
void __iomem *port_mmio;
u32 tmp;
tmp = readl(mmio + RESET_CFG);
if ((tmp & (1 << 0)) == 0) {
hpriv->signal[idx].amps = 0x7 << 8;
hpriv->signal[idx].pre = 0x1 << 5;
return;
}
port... | [
1,
0
] |
Linux Kernel | drivers/ata/sata_mv.c | static void mv_soc_enable_leds(struct mv_host_priv *hpriv, void __iomem *mmio) {
return;
} | [
0,
1
] |
Linux Kernel | drivers/ata/sata_mv.c | static void mv_soc_reset_hc_port(struct mv_host_priv *hpriv, void __iomem *mmio,
unsigned int port) {
void __iomem *port_mmio = mv_port_base(mmio, port);
mv_reset_channel(hpriv, mmio, port);
ZERO(0x028);
writel(0x101f, port_mmio + EDMA_CFG);
ZERO(0x004); /* timer */
ZERO(0... | [
0,
0
] |
Linux Kernel | drivers/ata/sata_mv.c |
static void mv_soc_reset_flash(struct mv_host_priv *hpriv, void __iomem *mmio) {
return;
} | [
0,
0
] |
Linux Kernel | drivers/ata/sata_mv.c |
static int mv_pmp_hardreset(struct ata_link *link, unsigned int *class,
unsigned long deadline) {
mv_pmp_select(link->ap, sata_srst_pmp(link));
return sata_std_hardreset(link, class, deadline);
} | [
0,
0
] |
Linux Kernel | drivers/ata/sata_mv.c |
static int mv_softreset(struct ata_link *link, unsigned int *class,
unsigned long deadline) {
mv_pmp_select(link->ap, sata_srst_pmp(link));
return ata_sff_softreset(link, class, deadline);
} | [
0,
0
] |
Linux Kernel | drivers/ata/sata_mv.c | static void mv_port_init(struct ata_ioports *port, void __iomem *port_mmio) {
void __iomem *serr, *shd_base = port_mmio + SHD_BLK;
port->data_addr = shd_base + (sizeof(u32) * ATA_REG_DATA);
port->error_addr = port->feature_addr =
shd_base + (sizeof(u32) * ATA_REG_ERR);
port->nsect_addr = shd_base + (size... | [
1,
0
] |
Linux Kernel | drivers/ata/sata_mv.c | static int mv_platform_suspend(struct platform_device *pdev,
pm_message_t state) {
struct ata_host *host = platform_get_drvdata(pdev);
if (host)
ata_host_suspend(host, state);
return 0;
} | [
0,
0
] |
Linux Kernel | drivers/ata/sata_mv.c | static int mv_platform_resume(struct platform_device *pdev) {
struct ata_host *host = platform_get_drvdata(pdev);
const struct mbus_dram_target_info *dram;
int ret;
if (host) {
struct mv_host_priv *hpriv = host->private_data;
dram = mv_mbus_dram_info();
if (dram)
mv_conf_mbus_windows(hpriv, ... | [
0,
0
] |
Linux Kernel | drivers/ata/sata_mv.c | static int mv_pci_device_resume(struct pci_dev *pdev) {
struct ata_host *host = pci_get_drvdata(pdev);
int rc;
rc = ata_pci_device_do_resume(pdev);
if (rc)
return rc;
rc = mv_init_host(host);
if (rc)
return rc;
ata_host_resume(host);
return 0;
}
#endif
#endif | [
0,
0
] |
Linux Kernel | drivers/ata/sata_mv.c |
static int __init mv_init(void) {
int rc = -ENODEV;
#ifdef CONFIG_PCI
rc = pci_register_driver(&mv_pci_driver);
if (rc < 0)
return rc;
#endif
rc = platform_driver_register(&mv_platform_driver);
#ifdef CONFIG_PCI
if (rc < 0)
pci_unregister_driver(&mv_pci_driver);
#endif
return rc;
} | [
0,
0
] |
Linux Kernel | drivers/ata/sata_nv.c |
static int nv_adma_check_atapi_dma(struct ata_queued_cmd *qc) {
struct nv_adma_port_priv *pp = qc->ap->private_data;
return !(pp->flags & NV_ADMA_ATAPI_SETUP_COMPLETE);
} | [
1,
0
] |
Linux Kernel | drivers/ata/sata_nv.c | static void nv_adma_irq_clear(struct ata_port *ap) {
struct nv_adma_port_priv *pp = ap->private_data;
void __iomem *mmio = pp->ctl_block;
u32 notifier_clears[2];
if (pp->flags & NV_ADMA_ATAPI_SETUP_COMPLETE) {
ata_bmdma_irq_clear(ap);
return;
}
writeb(NV_INT_ALL << (ap->port_no * NV_INT_PORT_SHIFT... | [
1,
0
] |
Linux Kernel | drivers/ata/sata_nv.c | static int nv_adma_port_resume(struct ata_port *ap) {
struct nv_adma_port_priv *pp = ap->private_data;
void __iomem *mmio = pp->ctl_block;
u16 tmp;
writel(pp->cpb_dma & 0xFFFFFFFF, mmio + NV_ADMA_CPB_BASE_LOW);
writel((pp->cpb_dma >> 16) >> 16, mmio + NV_ADMA_CPB_BASE_HIGH);
/* clear any outstanding inter... | [
1,
0
] |
Linux Kernel | drivers/ata/sata_nv.c | static irqreturn_t nv_generic_interrupt(int irq, void *dev_instance) {
struct ata_host *host = dev_instance;
unsigned int i;
unsigned int handled = 0;
unsigned long flags;
spin_lock_irqsave(&host->lock, flags);
for (i = 0; i < host->n_ports; i++) {
struct ata_port *ap = host->ports[i];
struct ata_... | [
1,
0
] |
Linux Kernel | drivers/ata/sata_nv.c |
static irqreturn_t nv_ck804_interrupt(int irq, void *dev_instance) {
struct ata_host *host = dev_instance;
u8 irq_stat;
irqreturn_t ret;
spin_lock(&host->lock);
irq_stat = readb(host->iomap[NV_MMIO_BAR] + NV_INT_STATUS_CK804);
ret = nv_do_interrupt(host, irq_stat);
spin_unlock(&host->lock);
return re... | [
0,
0
] |
Linux Kernel | drivers/ata/sata_nv.c |
static int nv_scr_write(struct ata_link *link, unsigned int sc_reg, u32 val) {
if (sc_reg > SCR_CONTROL)
return -EINVAL;
iowrite32(val, link->ap->ioaddr.scr_addr + (sc_reg * 4));
return 0;
} | [
1,
0
] |
Linux Kernel | drivers/ata/sata_nv.c |
static void nv_mcp55_freeze(struct ata_port *ap) {
void __iomem *mmio_base = ap->host->iomap[NV_MMIO_BAR];
int shift = ap->port_no * NV_INT_PORT_SHIFT_MCP55;
u32 mask;
writel(NV_INT_ALL_MCP55 << shift, mmio_base + NV_INT_STATUS_MCP55);
mask = readl(mmio_base + NV_INT_ENABLE_MCP55);
mask &= ~(NV_INT_ALL_M... | [
1,
0
] |
Linux Kernel | drivers/ata/sata_nv.c | static void nv_swncq_qc_to_dq(struct ata_port *ap, struct ata_queued_cmd *qc) {
struct nv_swncq_port_priv *pp = ap->private_data;
struct defer_queue *dq = &pp->defer_queue;
WARN_ON(dq->tail - dq->head == ATA_MAX_QUEUE);
dq->defer_bits |= (1 << qc->hw_tag);
dq->tag[dq->tail++ & (ATA_MAX_QUEUE - 1)] = qc->hw_t... | [
0,
0
] |
Linux Kernel | drivers/ata/sata_nv.c | static struct ata_queued_cmd *nv_swncq_qc_from_dq(struct ata_port *ap) {
struct nv_swncq_port_priv *pp = ap->private_data;
struct defer_queue *dq = &pp->defer_queue;
unsigned int tag;
if (dq->head == dq->tail)
return NULL;
tag = dq->tag[dq->head & (ATA_MAX_QUEUE - 1)];
dq->tag[dq->head++ & (ATA_MAX_QU... | [
0,
0
] |
Linux Kernel | drivers/ata/sata_nv.c |
static void nv_swncq_irq_clear(struct ata_port *ap, u16 fis) {
struct nv_swncq_port_priv *pp = ap->private_data;
writew(fis, pp->irq_block);
} | [
0,
0
] |
Linux Kernel | drivers/ata/sata_nv.c | static int nv_swncq_port_suspend(struct ata_port *ap, pm_message_t mesg) {
void __iomem *mmio = ap->host->iomap[NV_MMIO_BAR];
u32 tmp;
writel(~0, mmio + NV_INT_STATUS_MCP55);
/* disable irq */
writel(0, mmio + NV_INT_ENABLE_MCP55);
/* disable swncq */
tmp = readl(mmio + NV_CTL_MCP55);
tmp &= ~(NV_CTL... | [
1,
0
] |
Linux Kernel | drivers/ata/sata_nv.c | static int nv_swncq_slave_config(struct scsi_device *sdev) {
struct ata_port *ap = ata_shost_to_port(sdev->host);
struct pci_dev *pdev = to_pci_dev(ap->host->dev);
struct ata_device *dev;
int rc;
u8 rev;
u8 check_maxtor = 0;
unsigned char model_num[ATA_ID_PROD_LEN + 1];
rc = ata_scsi_slave_config(sdev)... | [
1,
0
] |
Linux Kernel | drivers/ata/sata_nv.c | static int nv_pci_device_resume(struct pci_dev *pdev) {
struct ata_host *host = pci_get_drvdata(pdev);
struct nv_host_priv *hpriv = host->private_data;
int rc;
rc = ata_pci_device_do_resume(pdev);
if (rc)
return rc;
if (pdev->dev.power.power_state.event == PM_EVENT_SUSPEND) {
if (hpriv->type >= CK... | [
0,
0
] |
Linux Kernel | drivers/ata/sata_nv.c | static void nv_ck804_host_stop(struct ata_host *host) {
struct pci_dev *pdev = to_pci_dev(host->dev);
u8 regval;
pci_read_config_byte(pdev, NV_MCP_SATA_CFG_20, ®val);
regval &= ~NV_MCP_SATA_CFG_20_SATA_SPACE_EN;
pci_write_config_byte(pdev, NV_MCP_SATA_CFG_20, regval);
} | [
0,
0
] |
Linux Kernel | drivers/ata/sata_promise.c | static void pdc_fpdma_clear_interrupt_flag(struct ata_port *ap) {
void __iomem *sata_mmio = ap->ioaddr.scr_addr;
u32 tmp;
tmp = readl(sata_mmio + PDC_FPDMA_CTLSTAT);
tmp |= PDC_FPDMA_CTLSTAT_DMASETUP_INT_FLAG;
tmp |= PDC_FPDMA_CTLSTAT_SETDB_INT_FLAG;
writeb(tmp >> 8, sata_mmio + PDC_FPDMA_CTLSTAT + 1);
... | [
1,
0
] |
Linux Kernel | drivers/ata/sata_promise.c | static void pdc_fpdma_reset(struct ata_port *ap) {
void __iomem *sata_mmio = ap->ioaddr.scr_addr;
u8 tmp;
tmp = (u8)readl(sata_mmio + PDC_FPDMA_CTLSTAT);
tmp &= 0x7F;
tmp |= PDC_FPDMA_CTLSTAT_RESET;
writeb(tmp, sata_mmio + PDC_FPDMA_CTLSTAT);
readl(sata_mmio + PDC_FPDMA_CTLSTAT);
udelay(100);
tmp &= ... | [
1,
0
] |
Linux Kernel | drivers/ata/sata_promise.c |
static void
pdc_clear_internal_debug_record_error_register(struct ata_port *ap) {
void __iomem *sata_mmio = ap->ioaddr.scr_addr;
writel(0xffffffff, sata_mmio + PDC_SATA_ERROR);
writel(0xffff0000, sata_mmio + PDC_LINK_LAYER_ERRORS);
} | [
0,
0
] |
Linux Kernel | drivers/ata/sata_promise.c |
static int pdc_sata_scr_write(struct ata_link *link, unsigned int sc_reg,
u32 val) {
if (sc_reg > SCR_CONTROL)
return -EINVAL;
writel(val, link->ap->ioaddr.scr_addr + (sc_reg * 4));
return 0;
} | [
1,
0
] |
Linux Kernel | drivers/ata/sata_promise.c |
static enum ata_completion_errors pdc_qc_prep(struct ata_queued_cmd *qc) {
struct pdc_port_priv *pp = qc->ap->private_data;
unsigned int i;
switch (qc->tf.protocol) {
case ATA_PROT_DMA:
pdc_fill_sg(qc);
fallthrough;
case ATA_PROT_NODATA:
i = pdc_pkt_header(&qc->tf, qc->ap->bmdma_prd_dma, qc->dev... | [
1,
0
] |
Linux Kernel | drivers/ata/sata_promise.c |
static int pdc_is_sataii_tx4(unsigned long flags) {
const unsigned long mask = PDC_FLAG_GEN_II | PDC_FLAG_4_PORTS;
return (flags & mask) == mask;
} | [
1,
0
] |
Linux Kernel | drivers/ata/sata_promise.c |
static unsigned int pdc_port_no_to_ata_no(unsigned int port_no,
int is_sataii_tx4) {
static const unsigned char sataii_tx4_port_remap[4] = {3, 1, 0, 2};
return is_sataii_tx4 ? sataii_tx4_port_remap[port_no] : port_no;
} | [
1,
0
] |
Linux Kernel | drivers/ata/sata_promise.c | static unsigned int pdc_ata_port_to_ata_no(const struct ata_port *ap) {
void __iomem *ata_mmio = ap->ioaddr.cmd_addr;
void __iomem *host_mmio = ap->host->iomap[PDC_MMIO_BAR];
return (ata_mmio - host_mmio - 0x200) / 0x80;
} | [
1,
0
] |
Linux Kernel | drivers/ata/sata_promise.c | static int pdc_sata_hardreset(struct ata_link *link, unsigned int *class,
unsigned long deadline) {
if (link->ap->flags & PDC_FLAG_GEN_II)
pdc_not_at_command_packet_phase(link->ap);
pdc_hard_reset_port(link->ap);
pdc_reset_port(link->ap);
/* sata_promise can't reliably acquir... | [
1,
0
] |
Linux Kernel | drivers/ata/sata_promise.c |
static unsigned int pdc_host_intr(struct ata_port *ap,
struct ata_queued_cmd *qc) {
unsigned int handled = 0;
void __iomem *ata_mmio = ap->ioaddr.cmd_addr;
u32 port_status, err_mask;
err_mask = PDC_ERR_MASK;
if (ap->flags & PDC_FLAG_GEN_II)
err_mask &= ~PDC1_ERR_MASK;
... | [
1,
0
] |
Linux Kernel | drivers/ata/sata_promise.c |
static void pdc_exec_command_mmio(struct ata_port *ap,
const struct ata_taskfile *tf) {
WARN_ON(tf->protocol == ATA_PROT_DMA || tf->protocol == ATAPI_PROT_DMA);
ata_sff_exec_command(ap, tf);
} | [
1,
0
] |
Linux Kernel | drivers/ata/sata_promise.c | static int pdc_old_sata_check_atapi_dma(struct ata_queued_cmd *qc) { return 1; } | [
0,
0
] |
Linux Kernel | drivers/ata/sata_promise.h | static inline unsigned int pdc_prep_lba48(struct ata_taskfile *tf, u8 *buf,
unsigned int i) {
/* ATA command block registers */
buf[i++] = (2 << 5) | ATA_REG_FEATURE;
buf[i++] = tf->hob_feature;
buf[i++] = tf->feature;
buf[i++] = (2 << 5) | ATA_REG_NSECT;
buf[i++]... | [
1,
0
] |
Linux Kernel | drivers/ata/sata_qstor.c |
static int qs_scr_read(struct ata_link *link, unsigned int sc_reg, u32 *val) {
if (sc_reg > SCR_CONTROL)
return -EINVAL;
*val = readl(link->ap->ioaddr.scr_addr + (sc_reg * 8));
return 0;
} | [
1,
0
] |
Linux Kernel | drivers/ata/sata_qstor.c |
static void qs_error_handler(struct ata_port *ap) {
qs_enter_reg_mode(ap);
ata_sff_error_handler(ap);
} | [
0,
0
] |
Linux Kernel | drivers/ata/sata_qstor.c | static enum ata_completion_errors qs_qc_prep(struct ata_queued_cmd *qc) {
struct qs_port_priv *pp = qc->ap->private_data;
u8 dflags = QS_DF_PORD, *buf = pp->pkt;
u8 hflags = QS_HF_DAT | QS_HF_IEN | QS_HF_VLD;
u64 addr;
unsigned int nelem;
qs_enter_reg_mode(qc->ap);
if (qc->tf.protocol != ATA_PROT_DMA)
... | [
1,
0
] |
Linux Kernel | drivers/ata/sata_qstor.c | static inline unsigned int qs_intr_pkt(struct ata_host *host) {
unsigned int handled = 0;
u8 sFFE;
u8 __iomem *mmio_base = qs_mmio_base(host);
do {
u32 sff0 = readl(mmio_base + QS_HST_SFF);
u32 sff1 = readl(mmio_base + QS_HST_SFF + 4);
u8 sEVLD = (sff1 >> 30) & 0x01;
sFFE = sff1 >> 31; /* empty... | [
1,
0
] |
Linux Kernel | drivers/ata/sata_qstor.c | static int qs_set_dma_masks(struct pci_dev *pdev, void __iomem *mmio_base) {
u32 bus_info = readl(mmio_base + QS_HID_HPHY);
int dma_bits = (bus_info & QS_HPHY_64BIT) ? 64 : 32;
int rc;
rc = dma_set_mask_and_coherent(&pdev->dev, DMA_BIT_MASK(dma_bits));
if (rc)
dev_err(&pdev->dev, "%d-bit DMA enable faile... | [
0,
0
] |
Linux Kernel | drivers/ata/sata_rcar.c | static void sata_rcar_thaw(struct ata_port *ap) {
struct sata_rcar_priv *priv = ap->host->private_data;
void __iomem *base = priv->base;
iowrite32(~(u32)SATA_RCAR_INT_MASK, base + SATAINTSTAT_REG);
ata_sff_thaw(ap);
/* unmask */
iowrite32(priv->sataint_mask & ~SATA_RCAR_INT_MASK, base + SATAINTMASK_REG);... | [
1,
0
] |
Linux Kernel | drivers/ata/sata_rcar.c |
static void sata_rcar_ioread16_rep(void __iomem *reg, void *buffer, int count) {
u16 *ptr = buffer;
while (count--) {
u16 data = ioread32(reg);
*ptr++ = data;
}
} | [
0,
0
] |
Linux Kernel | drivers/ata/sata_rcar.c |
static void sata_rcar_iowrite16_rep(void __iomem *reg, void *buffer,
int count) {
const u16 *ptr = buffer;
while (count--)
iowrite32(*ptr++, reg);
} | [
0,
0
] |
Linux Kernel | drivers/ata/sata_rcar.c |
static void sata_rcar_set_devctl(struct ata_port *ap, u8 ctl) {
iowrite32(ctl, ap->ioaddr.ctl_addr);
} | [
0,
0
] |
Linux Kernel | drivers/ata/sata_rcar.c | static int sata_rcar_bus_softreset(struct ata_port *ap,
unsigned long deadline) {
struct ata_ioports *ioaddr = &ap->ioaddr;
iowrite32(ap->ctl, ioaddr->ctl_addr);
udelay(20);
iowrite32(ap->ctl | ATA_SRST, ioaddr->ctl_addr);
udelay(20);
iowrite32(ap->ctl, ioaddr->ctl_addr);... | [
0,
0
] |
Linux Kernel | drivers/ata/sata_rcar.c | static int sata_rcar_softreset(struct ata_link *link, unsigned int *classes,
unsigned long deadline) {
struct ata_port *ap = link->ap;
unsigned int devmask = 0;
int rc;
u8 err;
if (sata_rcar_ata_devchk(ap, 0))
devmask |= 1 << 0;
/* issue bus reset */
rc = sata_rcar_bus... | [
1,
0
] |
Linux Kernel | drivers/ata/sata_rcar.c |
static void sata_rcar_tf_read(struct ata_port *ap, struct ata_taskfile *tf) {
struct ata_ioports *ioaddr = &ap->ioaddr;
tf->status = sata_rcar_check_status(ap);
tf->error = ioread32(ioaddr->error_addr);
tf->nsect = ioread32(ioaddr->nsect_addr);
tf->lbal = ioread32(ioaddr->lbal_addr);
tf->lbam = ioread32(i... | [
0,
0
] |
Linux Kernel | drivers/ata/sata_rcar.c | static void sata_rcar_drain_fifo(struct ata_queued_cmd *qc) {
int count;
struct ata_port *ap;
if (qc == NULL || qc->dma_dir == DMA_TO_DEVICE)
return;
ap = qc->ap;
/* Drain up to 64K of data before we give up this recovery method */
for (count = 0; (ap->ops->sff_check_status(ap) & ATA_DRQ) && count < 6... | [
1,
0
] |
Linux Kernel | drivers/ata/sata_rcar.c | static void sata_rcar_bmdma_fill_sg(struct ata_queued_cmd *qc) {
struct ata_port *ap = qc->ap;
struct ata_bmdma_prd *prd = ap->bmdma_prd;
struct scatterlist *sg;
unsigned int si;
for_each_sg(qc->sg, sg, qc->n_elem, si) {
u32 addr, sg_len;
addr = (u32)sg_dma_address(sg);
sg_len = sg_dma_len(sg);
... | [
0,
0
] |
Linux Kernel | drivers/ata/sata_rcar.c |
static enum ata_completion_errors sata_rcar_qc_prep(struct ata_queued_cmd *qc) {
if (!(qc->flags & ATA_QCFLAG_DMAMAP))
return AC_ERR_OK;
sata_rcar_bmdma_fill_sg(qc);
return AC_ERR_OK;
} | [
0,
0
] |
Linux Kernel | drivers/ata/sata_rcar.c | static void sata_rcar_bmdma_setup(struct ata_queued_cmd *qc) {
struct ata_port *ap = qc->ap;
unsigned int rw = qc->tf.flags & ATA_TFLAG_WRITE;
struct sata_rcar_priv *priv = ap->host->private_data;
void __iomem *base = priv->base;
u32 dmactl;
mb(); /* make sure PRD table writes are visible to controller */
... | [
1,
0
] |
Linux Kernel | drivers/ata/sata_rcar.c |
static u8 sata_rcar_bmdma_status(struct ata_port *ap) {
struct sata_rcar_priv *priv = ap->host->private_data;
u8 host_stat = 0;
u32 status;
status = ioread32(priv->base + ATAPI_STATUS_REG);
if (status & ATAPI_STATUS_DEVINT)
host_stat |= ATA_DMA_INTR;
if (status & ATAPI_STATUS_ACT)
host_stat |= ATA... | [
1,
0
] |
Linux Kernel | drivers/ata/sata_rcar.c | static void sata_rcar_ata_interrupt(struct ata_port *ap) {
struct ata_queued_cmd *qc;
int handled = 0;
qc = ata_qc_from_tag(ap, ap->link.active_tag);
if (qc)
handled |= ata_bmdma_port_intr(ap, qc);
if (!handled)
sata_rcar_check_status(ap);
} | [
0,
0
] |
Linux Kernel | drivers/ata/sata_rcar.c | static irqreturn_t sata_rcar_interrupt(int irq, void *dev_instance) {
struct ata_host *host = dev_instance;
struct sata_rcar_priv *priv = host->private_data;
void __iomem *base = priv->base;
unsigned int handled = 0;
struct ata_port *ap;
u32 sataintstat;
unsigned long flags;
spin_lock_irqsave(&host->lo... | [
1,
0
] |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.